Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hay peeps,
My customer wants a moving month by month running total, so that it always shows the last 12 months regardless of year.
Output = Open and closed totals for last 12 months Open = Line Closed = Bars - So this month it would show the proceding 12 months, then next month this will change to the previous months.
I have a data model built on a star schema with a date table, but this not a requirement I have been asked before, as generally it is last FY or last Year not a moving year! So any pointers would be much appreciated.
Current Running Total measures I am trying:
Running total =
CALCULATE(
[Count],
DATESYTD( 'Date'[Date])
)
RT =
VAR _MaxDate = MAX( 'Date'[Date])
RETURN
CALCULATE(
[Count],
'Date'[Date] <= _MaxDate,
ALL( 'Date' )
)
Thanks in advance
Solved! Go to Solution.
You ar eright. My mistake. Excuse me
RT =
VAR _MaxDate = MAX( 'Date'[Date])
Hi, You can try this code
Rolling Sum Last 12 months =
CALCULATE (
[count] ),
ALL ( 'Table' ),
DATESBETWEEN (
'Calendar'[Date],
DATEADD ( _MaxDate, -11, MONTH ),
MaxDate )
)
)
Morning @JamesFR06
Thanks for the reply, is _MaxDate a VAR _MaxDate = MAX( Date[Date] ) ?
@JamesFR06 That's cool, I tried to add this in but DATEADD() says it will not take a Variable as the parameter? DATEADD( Dates, Number of Interval. Interval)
You ar eright. My mistake. Excuse me
RT =
VAR _MaxDate = MAX( 'Date'[Date])
User | Count |
---|---|
84 | |
69 | |
69 | |
65 | |
54 |
User | Count |
---|---|
93 | |
93 | |
91 | |
76 | |
69 |