Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, how can I stop the cumulative measure to stop at June? and reflect only blank values starting July?
Some DAX I tried:
#1.
Both are not solving the purpose (Stopping cumulative from July Onwards)
Thank you so much in advance 🙂
Solved! Go to Solution.
@Anonymous
Please refer to this solution Solved: Cumulative total - stopping after last date not wo... - Microsoft Power BI Community
Regards,
Ritesh
@Anonymous best practice is to add a column in your date table that checks for the last available date with sales, something like
DateWithSales =
INT('Date'[Date] <= MAX ( Sales[Order Date] ))
Then add it as filter to the filter pane of the report and set it to 1.
You can also do it robust to not need to add it to the filter pane by adding it to all your measures.
Somthing like, create this measure:
ShowValueForDates :=
VAR LastDateWithData =
CALCULATE (
MAX ( 'Sales'[Order Date] ),
REMOVEFILTERS ()
)
VAR FirstDateVisible =
MIN ( 'Date'[Date] )
VAR Result =
FirstDateVisible <= LastDateWithData
RETURN
Result
And then add it to your measure:
Sales YTD :=
IF (
[ShowValueForDates],
CALCULATE (
[Sales Amount],
DATESYTD ( 'Date'[Date] )
)
)
Anyway, for full explanation just go to the source 🙂 sqlbi.com:
https://www.daxpatterns.com/standard-time-related-calculations/
@Anonymous
Please refer to this solution Solved: Cumulative total - stopping after last date not wo... - Microsoft Power BI Community
Regards,
Ritesh
Thank you @ribisht17 I had to make some tweaks to make it work. Actually, the column I am using to generate the cumulative series is a measure. I defined the measure again in the maxx() function. This worked.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
50 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |