Forum Discussion
MTD - Calculation not working
andrewb95 , You should always use date table joined with date of your table
calculate(sum('Total -Count'[Count]), datesmtd('Date'[Date]))
Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
- andrewb954 years ago
Helper II
Hi Amit,
When creating a relationship to the date table (which I have updated as indicated above) the value actually changes to null so this is very unusual.
- v-kkf-msft4 years ago
Community Support
Hi andrewb95 ,
I could not reproduct your problem. Maybe you can try the following measures:
Measure1 = CALCULATE( SUM('Total - Count'[Count]), ALL('Total - Count'[Date]), DATESMTD('Total - Count'[Date]) )Measure2 = CALCULATE ( SUM ( 'Total - Count'[Count] ), FILTER ( ALL ( 'Total - Count' ), 'Total - Count'[Date] <= TODAY () && 'Total - Count'[Date] <= MAX ( 'Total - Count'[Date] ) && FORMAT ( 'Total - Count'[Date], "yyyymm" ) = FORMAT ( MAX ( 'Total - Count'[Date] ), "yyyymm" ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.