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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Using the following measure to calculate the current trailing 12-month sales amount:
Cumulative_Sales = CALCULATE(
if(
countrows(values('DATE'[Date])) = 1,
[TABC_SALES],
SUMX(
values('DATE'[Date]),
[TABC_SALES]
)
),
DATESINPERIOD(
'DATE'[Date],
LASTDATE('DATE'[Date]),
-12,
MONTH
)
)
Trying to calculate the previous trailing 12-month so I can compare the %'age difference between the two periods. So based on the sales data I have to date would need to compare 12/2016 - 11/2017 (current trailing 12-month period), and 12/2015 - 11/2016 (previous trailing 12-month period)
Thank you! ~db
Solved! Go to Solution.
Hi @dentonblake,
Could you try using the formula below to see if it works in your scenario?
previous trailing 12-month period Cumulative_Sales = CALCULATE ( IF ( COUNTROWS ( VALUES ( 'DATE'[Date] ) ) = 1, [TABC_SALES], SUMX ( VALUES ( 'DATE'[Date] ), [TABC_SALES] ) ), DATESINPERIOD ( 'DATE'[Date], EDATE ( LASTDATE ( 'DATE'[Date] ), -12 ), -12, MONTH ) )
Regards
Hi @dentonblake,
Could you try using the formula below to see if it works in your scenario?
previous trailing 12-month period Cumulative_Sales = CALCULATE ( IF ( COUNTROWS ( VALUES ( 'DATE'[Date] ) ) = 1, [TABC_SALES], SUMX ( VALUES ( 'DATE'[Date] ), [TABC_SALES] ) ), DATESINPERIOD ( 'DATE'[Date], EDATE ( LASTDATE ( 'DATE'[Date] ), -12 ), -12, MONTH ) )
Regards