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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

return name of max score

I have a table of scores which is filtered by year in a slicer. I am using the 'Enlighten Data Story' visual to tell who has the best score in the respective year. 

The max score is calculated correctly, but the name of the person with max score is not! 

name.PNG

 

can anybody say what is the problem? I am not using any DAX formulas, because if I am not wrong, it should be filtered via context, right?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

Try this MEASURE instead of FIRSTname

Measure will respond to filter context but won't respond to another measure.
So if you use a MEASURE for MAXscore it wont necessarily get you the top scorer's name

BestPerson =
MAXX (
    TOPN (
        1,
        VALUES ( TableName[Name] ),
        CALCULATE ( MAX ( TableName[Score] ) ), DESC
    ),
    [Name]
)

 


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

based on the screenshot the context is Year 2017, nothing more


with 'Max of score' you show the max score of 2017 (it's only in Values, so PowerBI looks at least of all score values in 2017 and picks the highest - no change in filter context)

similarly with First Name you show first name of 2017


you would need Score in Filters to filter for max value to have the filter context limited to the highest score, so I think using DAX is actually easier



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

Try this MEASURE instead of FIRSTname

Measure will respond to filter context but won't respond to another measure.
So if you use a MEASURE for MAXscore it wont necessarily get you the top scorer's name

BestPerson =
MAXX (
    TOPN (
        1,
        VALUES ( TableName[Name] ),
        CALCULATE ( MAX ( TableName[Score] ) ), DESC
    ),
    [Name]
)

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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