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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

12 Month Running Total as calculated column, not measure

I'd like to create a calculated column that shows running total. I've found plenty of examples for measures, but not columns.

 

For example, here is the measure. Can you help me convert this to a column?

 

SalesRolling =
CALCULATE (
    SUM ( 'Claims'[CLM_ACTL_PD_AMT] ),
    DATESBETWEEN (
        'Calendar'[FullDate],
        NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[FullDate] ) ) ),
        LASTDATE ( 'Calendar'[FullDate] )
    )
)

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

This seems to be working:

 

SalesRolling12M =
CALCULATE (
    SUM ( 'Claims'[CLM_ACTL_PD_AMT] ),
    ALLEXCEPT ( 'Claims', 'Claims'[MBR_SK] ),
    DATESBETWEEN (
        'Calendar'[FullDate],
        DATEADD ( LASTDATE ( 'Calendar'[FullDate] ), -11, MONTH ),
        //Eleven Months Ago
        LASTDATE ( 'Calendar'[FullDate] )
    )
)

This helped me: https://stackoverflow.com/questions/23835611/how-to-sum-a-column-based-on-another-column-in-dax-powe...

View solution in original post

4 REPLIES 4
rajulshah
Resident Rockstar
Resident Rockstar

Hello @Anonymous ,

 

If you want runnin total for the current year , you can use the DAX function TOTALYTD.

 

You can refer here:

https://msdn.microsoft.com/en-us/library/ee634400.aspx

 

Hope this helps.

 

Let me know if you need further help.

 

 

Anonymous
Not applicable

Nope, I want rolling 12 months, not YTD. Thanks though!

 

Also, my code isn't working because it's showing the running totals for all members in the table, even when I'm only showing one member. Back to the drawing board.

Anonymous
Not applicable

This seems to be working:

 

SalesRolling12M =
CALCULATE (
    SUM ( 'Claims'[CLM_ACTL_PD_AMT] ),
    ALLEXCEPT ( 'Claims', 'Claims'[MBR_SK] ),
    DATESBETWEEN (
        'Calendar'[FullDate],
        DATEADD ( LASTDATE ( 'Calendar'[FullDate] ), -11, MONTH ),
        //Eleven Months Ago
        LASTDATE ( 'Calendar'[FullDate] )
    )
)

This helped me: https://stackoverflow.com/questions/23835611/how-to-sum-a-column-based-on-another-column-in-dax-powe...

Anonymous
Not applicable

This seems to work. Let me know if there's a more elegant solution:

 

SalesRolling12M = 
CALCULATE (
    SUM ( 'Claims'[CLM_ACTL_PD_AMT] ),
    ALL ( 'Claims' ),
    DATESBETWEEN (
        'Calendar'[FullDate],
        DATEADD ( LASTDATE ( 'Calendar'[FullDate] ), -11, MONTH ), //Eleven Months Ago
        LASTDATE ( 'Calendar'[FullDate] )
    )
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors