Forum Discussion
Anonymous
6 years agoNot applicable
YTD DAX
Hi everyone,
I'm making a Dax measure to calculate a YTD, my measure is :
YTD = TOTALYTD([Monthly TNQ],'Calendar'[Date])
So according to this measure, my results are right, but the data are existing from 1/1/2019 to 1/9/2019 so in my bar chart the data are shown until 1/12/2019.
So I would like to change this measure in order to have the real results from 1/1/2019 to 1/9/2019.
Thank you.
Best regards.
Can you try like
YTD = var _max = max(table[date]) TOTALYTD([Monthly TNQ],'Calendar'[Date],'Calendar'[Date]<=_max)Hi Anonymous
Try something like
Sales YTD = IF( NOT ISEMPTY( Sales ), CALCULATE( [Sales], DATESYTD( 'Calendar'[Date] ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
6 Replies
- AnonymousNot applicable
this is the results on my bar chart graph :
- AnonymousNot applicable
- amitchandakSuper User
Can you try like
YTD = var _max = max(table[date]) TOTALYTD([Monthly TNQ],'Calendar'[Date],'Calendar'[Date]<=_max) - MariuszCommunity Champion
Hi Anonymous
Try something like
Sales YTD = IF( NOT ISEMPTY( Sales ), CALCULATE( [Sales], DATESYTD( 'Calendar'[Date] ) ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.- AnonymousNot applicable
Hi Mariusz
It does work and this is the results comparing Y vs Y-1 :
How can I get the results like is shown in this graph :
Thank you !
Best regards.