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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Running total previous year in one measure

HI All, 

 

I am setting up a calculation group and am looking for ONE measure which gives me the running total of previous year. I cannot reference another cumulative measure and use SAMEPERIODLASTYEAR. So I only have the [total sales] measure which I want to refrence in the new cumulative last year measure. 

 

I Want to accomplish this 

MonthThis year RTPrevious year RT
124
256
378
499
51111
61412
71715
81918
93022

 

Hope you can help me

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

A more specific expression can be provided with example data that has you Date and Sales Tables/Column, but you can get a PY RT with an expression like this.  Note this assume you have a Date table, marked as a date table.

 

PY RT =
VAR vThisDate =
    MAX ( Date[Date] )
VAR vPYThisDate =
    EDATE (
        vThisDate,
        -12
    )
VAR vPYStart =
    DATE ( YEAR ( vPYThisDate )11 )
VAR vResult =
    CALCULATE (
        [Total Sales],
        FILTER (
            ALL ( Date[Date] ),
            Date[Date] >= vPYStart
                && Date[Date] <= vPYThisDate
        )
    )
RETURN
    vResult

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

A more specific expression can be provided with example data that has you Date and Sales Tables/Column, but you can get a PY RT with an expression like this.  Note this assume you have a Date table, marked as a date table.

 

PY RT =
VAR vThisDate =
    MAX ( Date[Date] )
VAR vPYThisDate =
    EDATE (
        vThisDate,
        -12
    )
VAR vPYStart =
    DATE ( YEAR ( vPYThisDate )11 )
VAR vResult =
    CALCULATE (
        [Total Sales],
        FILTER (
            ALL ( Date[Date] ),
            Date[Date] >= vPYStart
                && Date[Date] <= vPYThisDate
        )
    )
RETURN
    vResult

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.