Forum Discussion
Modify DAX Code to get Year-To-Date total
Hi, the code below is to show the Total Actuals (on a PBI chart) for a project through the most recent month ended (e.g. June 2022).
Thank you!
2 Replies
- lbendlinSuper User
In your calendar table create a calculated column that computes if a date in a prior period (month, quarter, year) should be considered . Have the table in import mode, refreshed daily.
Then you can include that flag in your filters like so:
PY = CALCULATE ( [Sales], SAMEPERIODLASTYEAR ( Dates[date] ), Dates[IsPastPY] = TRUE ) - v-kkf-msftCommunity Support
Hi Anonymous ,
How do you calculate [Max Date] and [Current Month Offset]? Maybe you can try the measure.
Total Amount Actuals = IF ( [Max Date] > [Current Month Offset], BLANK (), CALCULATE ( [CapEx Actuals], FILTER ( ALLSELECTED ( 'Dim Date' ), 'Dim Date'[Date] <= TODAY () ) ) )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,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.