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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

The measure with the rank function doesn't change while using slicer

This is a follow-up from this thread: 
https://community.fabric.microsoft.com/t5/Desktop/How-to-find-the-difference-between-last-value-of-c...

The base question is resolved, But right now when I use the pbix given in this solution, with the sample data provided in the link:
https://docs.google.com/spreadsheets/d/1OSi8QvBQ3b-4WWn73ypl4hn1Yp0ll2M4/edit?usp=sharing&ouid=11222...
The measure Value Max id Last Day PM doesn't change/ gives wrong values according to the change taken from the silcer with Name column:

nishad1092_0-1688645010666.png

Maybe the Rank function isn't working well with the Name given as silcer. But this is the expected result, Please kindly support.

Hi @lucadelicio Could you kindly support on this as well.  It would be really helpful.

 

1 ACCEPTED SOLUTION
lucadelicio
Super User
Super User

Hi Nish,
 
change the ALL(Sheet1) with ALLEXCEPT(Sheet1, Sheet1[Name]) in the P measure like this:

LastDay PM =
var _cRank = MAX(Sheet1[Rank])
RETURN
CALCULATE(
    MAXX(Sheet1, MAX(Sheet1[LocalSystemDate]))
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[Rank] = _cRank - 1
)

Value Max Id Last Day PM =
var _lastDayPM = [LastDay PM]
var _maxId =
CALCULATE(
    MAXX(
        Sheet1
        ,MAX(Sheet1[Id])
    )
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[LocalSystemDate] = _lastDayPM
)
var _value =
CALCULATE(
    SUM(Sheet1[Value])
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[LocalSystemDate] = _lastDayPM
    ,Sheet1[Id] = _maxId
)
RETURN _value

Let me know
Ciao!


Luca D'Elicio

LinkedIn Profile

View solution in original post

3 REPLIES 3
lucadelicio
Super User
Super User

Hi Nish,
 
change the ALL(Sheet1) with ALLEXCEPT(Sheet1, Sheet1[Name]) in the P measure like this:

LastDay PM =
var _cRank = MAX(Sheet1[Rank])
RETURN
CALCULATE(
    MAXX(Sheet1, MAX(Sheet1[LocalSystemDate]))
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[Rank] = _cRank - 1
)

Value Max Id Last Day PM =
var _lastDayPM = [LastDay PM]
var _maxId =
CALCULATE(
    MAXX(
        Sheet1
        ,MAX(Sheet1[Id])
    )
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[LocalSystemDate] = _lastDayPM
)
var _value =
CALCULATE(
    SUM(Sheet1[Value])
    ,ALLEXCEPT(Sheet1, Sheet1[Name])
    ,Sheet1[LocalSystemDate] = _lastDayPM
    ,Sheet1[Id] = _maxId
)
RETURN _value

Let me know
Ciao!


Luca D'Elicio

LinkedIn Profile
Anonymous
Not applicable

Thank you very much Luca
It worked perfectly !! 

You are amazing 🙂 

Anonymous
Not applicable

Hi, 
Could anyone support on this please ?

 

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.