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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.