Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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 @Anonymous,
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
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 33 | |
| 30 |
| User | Count |
|---|---|
| 138 | |
| 126 | |
| 60 | |
| 59 | |
| 56 |