Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I'm trying to calculate at Running Total over dates and then group by month, quarter and year.
I have this measure showing a running total of sales.
It works just fine on regulary dates, but if I group by year or sort out a year it doesn't work anymore:
What's wrong with my measure?
Solved! Go to Solution.
Hi @Anonymous ,
Please try this
Total Sales Amount RT =
VAR MaxDate =
MAX ( 'Calendar'[Date] )
VAR Result =
CALCULATE (
[Total Sales Amount],
FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] < MaxDate )
)
RETURN
Result
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try this
Total Sales Amount RT =
VAR MaxDate =
MAX ( 'Calendar'[Date] )
VAR Result =
CALCULATE (
[Total Sales Amount],
FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] < MaxDate )
)
RETURN
Result
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, but this only works if you are after YTD.
It will start over 1. jan.
I need it to be a running total regardless of the year.
Hi Krestensb,
If you want it by year use totalytd, it will do it automatically
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |