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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors