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
RochelReyes
Frequent Visitor

Getting the previous value of a measure using Date(year) as a criteria

Hi Everyone,

 

I would like to ask for your help on computing for the previous value of a measure.
I have a table that looks like this:

RochelReyes_1-1707734344519.png

To give context on this, the values above are base on the total score that are our exhibitors per event year are giving us which has the following formula 

NPS_score = ((CALCULATE(DISTINCTCOUNT(research_kpi[responseid]), research_kpi[NPSgroup] = "Promoters (9-10)")
                / CALCULATE(DISTINCTCOUNT(research_kpi[responseid]), research_kpi[NPSgroup] <> BLANK()))
            -
        (CALCULATE(DISTINCTCOUNT(research_kpi[responseid]), research_kpi[NPSgroup] = "Detractors (0-6)")
                 / CALCULATE(DISTINCTCOUNT(research_kpi[responseid]), research_kpi[NPSgroup] <> BLANK()))

) * 100


What I would like to attain is the previous value of the previous year just like this table:

RochelReyes_2-1707734572751.png

I tried using this formula

PreviousNPSScore = CALCULATE([NPS_score], FILTER(research_kpi, research_kpi[year] = PREVIOUSYEAR(research_kpi[year])))
but I am getting no values at all.

May I know if there is a workaround on this?

Thank you.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

This looks like a good candidate for OFFSET.

 

Try this:

PreviousNPSScore =
CALCULATE (
    [NPS_score],
    OFFSET (
        -1,
        ORDERBY ( research_kpi[Year], ASC )
    )
)

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

This looks like a good candidate for OFFSET.

 

Try this:

PreviousNPSScore =
CALCULATE (
    [NPS_score],
    OFFSET (
        -1,
        ORDERBY ( research_kpi[Year], ASC )
    )
)

Thank you so much for this. This has been solved😊

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.