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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BobKoenen
Helper IV
Helper IV

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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