Forum Discussion
YTD dynamic table in dax
- 1 year ago
Hi Sándor
If you are trying to exclude future dates from showing up in YTD, you can use double calculate. Also, please start using a separate dates/calendar table that's been marked as such. Set and use date tables in Power BI Desktop
YTD Value today = VAR _MAX = TODAY () RETURN CALCULATE ( CALCULATE ( SUM ( 'Table'[Value] ), DATESYTD ( 'Calendar'[Date] ) ), KEEPFILTERS ( 'Calendar'[Date] <= _MAX ) )Please see the attached pbix.
- 1 year ago
Hi Sándor ,
I tried to replicate and fix the issue, Please find the attached pbix file for oyur reference.
YTD dynamic table in dax.pbixPlease let me know if you have further questions.
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi
LinkedIn - http://www.linkedin.com/in/maruthi-siva-prasad/
X - Maruthi Siva Prasad - (@MaruthiSP) / X
Hi Sándor
If you are trying to exclude future dates from showing up in YTD, you can use double calculate. Also, please start using a separate dates/calendar table that's been marked as such. Set and use date tables in Power BI Desktop
YTD Value today =
VAR _MAX =
TODAY ()
RETURN
CALCULATE (
CALCULATE ( SUM ( 'Table'[Value] ), DATESYTD ( 'Calendar'[Date] ) ),
KEEPFILTERS ( 'Calendar'[Date] <= _MAX )
)
Please see the attached pbix.
Dear danextian Ashish_Excel!
Thank you very much for your help.
It worked well.
In the meanwhile I came up with another solution as well.
danextian I am using a different data table in my main model. I just wanted to make the explanation simple.
Thank you
Br
S