Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I need a dax to calculate cumulative sales of Prior Year (which is -12 month)-12 month.
I used this dax to get -12M rolling cumulative sales
Solved! Go to Solution.
Hi,
Try this measure
Measure = calculate([sales SUM],datesbetween('Date table',edate(min('date table'[date]),-11),max('date table'[date])))
Hope this helps.
Hi,
Try this measure
Measure = calculate([sales SUM],datesbetween('Date table',edate(min('date table'[date]),-11),max('date table'[date])))
Hope this helps.
Hi @Niks_S,
If the time intelligence function not fully works for your requirement, you can also tied to manually define a variable to calculate previous date and use in calculations:
YTD_SALES_tag cy =
VAR currDate =
MAX ( 'Date Table'[Date] )
RETURN
CALCULATE (
[Sales SUM],
FILTER (
ALLSELECTED ( 'Date Table' ),
'Date Table'[Date] <= currDate
&& 'Date Table'[Date]
> DATE ( YEAR ( currDate ), MONTH ( currDate ) - 12, DAY ( currDate ) )
)
)
BTW, how did the [Sales SUM] expression calculated? Can you please share some more detail?
Regards,
Xiaoxin Sheng
Hi @v-shex-msft,
Thank you for your reply
The sales Sum is raw data, calculated with calculate Sum dax.
I want to have rolling cumulative 12 M of previous to previous year numbers (Like i did for previous 12 M)
Hi @Niks_S ,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
User | Count |
---|---|
128 | |
72 | |
70 | |
58 | |
53 |
User | Count |
---|---|
192 | |
96 | |
67 | |
64 | |
54 |