Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48104

Re: DAX first day of current month

$
0
0

My suggestion:

 

Previous month score for top scorer = 
VAR TopScorers = TOPN( 1, VALUES( Scores[name] ), CALCULATE(AVERAGE(Scores[Score])) ) VAR PrevMonth = CALCULATETABLE( DATEADD(Scores[Date],-1, MONTH), LASTDATE( Scores[Date]) ) RETURN CALCULATE( AVERAGE(Scores[Score]) , TopScorers , PrevMonth )

 

Note the TOPN function wil return several players if you have ties in your current selection. Hence the average calculation.

 

Also, in case several months/dates are selected, I take the last one and calculate the previous month for this date.


Viewing all articles
Browse latest Browse all 48104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>