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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Dyke211
Helper I
Helper I

I want to show a previous score value

Hello, I want to display previous score value of each "score title".. Like for instance "Strategy" in Month 01-june-2024 has a score value of  3 but in December 2023 Strategy has a value of "2" so i want to display this value score of "2" in the previous score column . Kindly help me dax code

 

 

 

 

What I Have                                                                                       What i Want

 

Screenshot 2024-05-22 144432.png Screenshot 2024-05-22 145247.png

1 ACCEPTED SOLUTION

Previous Score = 
VAR CurrentAccount = 'Table'[Account]
VAR CurrentScoreTitle = 'Table'[Score Title]
VAR CurrentAssessmentMonth = 'Table'[Assessment Month]

RETURN
    CALCULATE(
        MAX('Table'[Score Value]),
        FILTER(
            ALL('Table'),
            'Table'[Account] = CurrentAccount &&
            'Table'[Score Title] = CurrentScoreTitle &&
            'Table'[Assessment Month] < CurrentAssessmentMonth
        )
    )

aduguid_0-1716432779595.png

View solution in original post

4 REPLIES 4
AntrikshSharma
Super User
Super User

@Dyke211 Try these:

 

CALCULATE ( 
    SUM ( Table[Score Value] ),
    OFFSET ( 
        -1,
        ALL ( Table[Account], Table[Score Title], Table[Score Value], Table[Assessment Month] ),
        ORDERBY ( Table[Assessment Month], ASC ),
        PARTITIONBY ( Table[Account], Table[Score Title] )
    ),
    REMOVEFILTERS ( Table )
)

 

 

 

and 

 

VAR CurrentMonth = 
    Table[Assessment Month]
RETURN
    CALCULATE ( 
        MAX ( Table[Score Value] ),
        Table[Assessment Month] < CurrentMonth,
        ALLEXCEPT ( Table, Table[Score Title] )
    )

 

 

I just tried but didnt work

Dyke211
Helper I
Helper I

Still in need of a help

Previous Score = 
VAR CurrentAccount = 'Table'[Account]
VAR CurrentScoreTitle = 'Table'[Score Title]
VAR CurrentAssessmentMonth = 'Table'[Assessment Month]

RETURN
    CALCULATE(
        MAX('Table'[Score Value]),
        FILTER(
            ALL('Table'),
            'Table'[Account] = CurrentAccount &&
            'Table'[Score Title] = CurrentScoreTitle &&
            'Table'[Assessment Month] < CurrentAssessmentMonth
        )
    )

aduguid_0-1716432779595.png

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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