Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
management wants to see the accumulated sales until now vs the accumulated sales from the last two years in a graphic displaying the last 24 months.
I have written this measure for the rolling numbers, thinking that MAX Date was related to our current time (today). Instead, Max date looks at row level and so it computes rolling numbers backwards, which is not what we want.
Sales cumulated rolling =
CALCULATE (
[Total Sales],
DATESINPERIOD ( 'Datetable'[Date],
MAX ( 'Datetable'[Date] ),
-24,
MONTH
))
With this, I will see the accumulated sales with May 2022 as a label but including numbers from 2020. What I need is basically the raw numbers since January 2022, accumulated.
I have looked around, but I am lost. Can someone help here?
Thanks!
Pauline.
hi @Berl21 ,
If you can share pbix file with any sensitive data removed that will help. This is what you can try
Create a Measure(Assuming you have date field in your visual)
@Berl21 Try this, just use SUMX instead of AVERAGEX: Better Rolling Average - Microsoft Fabric Community
Hi,
I still have the issue with the backward calculation. Don't know how to get around this, maybe the issue is that the date table should be switched for another one.
The last available date in this table is 31st of December 2030. Instead of today.
Hence, this can't work either:
VAR __DATE_PERIOD =
DATESBETWEEN(
'Datetable'[Date].[Date],
STARTOFMONTH(DATEADD(__LAST_DATE, -24, MONTH)),
ENDOFMONTH(DATEADD(__LAST_DATE, 0, MONTH))
How can I replace these lines?
@Berl21 I don't see why that makes a difference how many dates are in the Dates table. What matters is what date is in context at the time and for dates beyond today, you can just add a condition where if that is the case, return BLANK.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |