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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!