date - DAX compare two years YTD -


i need compare data year data last year. customer wants switch between full year , year-to-date comparison. full year have, year-to-date want see how going compared data today last year e.g.:

full data jan 2016 - 24. aug (today)
compared jan 2015 - 24. aug 2015.

how implement in dax? i'm using in power bi.

supposing have measure called [sales], calculated fact table, , dates table, can write 2 new measures compare data year , previous:

sales ytd = calculate ( [sales]; datesytd ( 'dates'[date] ) )
sales py ytd = calculate ( [sales]; dateadd ( datesytd ( 'dates'[date] ); -1; year ) )

putting in matrix visualization, give following:

please remember have 'dates' relationship sales table correctly configured in order have time intelligence calculations done right. can find more info here.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -