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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Mapping Value by max in a group

Hi, I am struggling to achieve result below. I've already tried several functions with no result. The idea is to get in each row for a particular group, name of the person who got the max value.

 

GroupNameCountryValue*Top Name
AJonDE1Judy
AChrisGB2Judy
AJudyFR3Judy
BAdamIT10Barbara
BMikePL20Barbara
BBarbaraCZ30Barbara
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

try new measure

Measure = LOOKUPVALUE(
Table1[Name];
Table1[Value];CALCULATE(max(Table1[Value]);ALLEXCEPT(Table1;Table1[Group]));
Table1[Group];selectedvalue(Table1[Group])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
Linkedin


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

4 REPLIES 4
az38
Community Champion
Community Champion

Hi @Anonymous 

try new measure

Measure = LOOKUPVALUE(
Table1[Name];
Table1[Value];CALCULATE(max(Table1[Value]);ALLEXCEPT(Table1;Table1[Group]));
Table1[Group];selectedvalue(Table1[Group])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
Linkedin


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Awesome, thank you a lot, it works perfectly. If it's not a big problem, could you share more insights how the CALCULATE works with the SELECTEDVALUE inside a LOOKUPVALUE? I know each one of them, but the combination is what gives me trouble.

Thanks again 🙂

az38
Community Champion
Community Champion

@Anonymous 

well, lets try. we create a measure that will have a value in each row.

so, selectedvalue - is a value of selected field in each given row.

 

in tis solution for each row we:

first, looking for a max value for group 

CALCULATE(max(Table1[Value]);ALLEXCEPT(Table1;Table1[Group]));

then make a lookupvalue this MAX value in the same table

and at last we check if this MAX value is about Group in the row (because, it could be a several different groups with the same MAX value)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution
Linkedin


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thank you once again, I really apreciate your help!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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