Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
dentonblake
Helper II
Helper II

Previous 12-month trailing measure

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

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @dentonblake,

 

Could you try using the formula below to see if it works in your scenario? Smiley Happy

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

View solution in original post

1 REPLY 1
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @dentonblake,

 

Could you try using the formula below to see if it works in your scenario? Smiley Happy

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors