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! Learn more

Reply
Anonymous
Not applicable

A simple question, for a newbi user

Hey there,

i somehow with the help of the internet managed to get the maximum value of the sum by a category, followed by that scrpit:

max value = MAXX(SUMMARIZE(Products, Products[Category_Name], "rev", SUM(Products[rev])), [rev])
and im now trying to get the category name of that measure, and i have no idea how to do it.
Un1111titled.png
   that is the value that i got, and and i want to see which category it is.
thanks!!! 🙂
1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

Maybe not the best solution but should work

create a rank measure

RankMeasure = RANKX(ALL(Products[Category_Name]),CALCULATE(SUM(Products[rev])),,DESC)

then your desired

TopCategoryMeasure = calculate(
FIRSTNONBLANK(Products[Category_Name],1), 
FILTER(ALL(Products[Category_Name]),[RankMeasure]=1)
)

 


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

View solution in original post

4 REPLIES 4
Stachu
Community Champion
Community Champion

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1 Column2
A 1
B 2.5

 



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

Anonymous
Not applicable

Un1111titled.png

here is the example of the data i work with,

thanks

az38
Community Champion
Community Champion

Hi @Anonymous 

Maybe not the best solution but should work

create a rank measure

RankMeasure = RANKX(ALL(Products[Category_Name]),CALCULATE(SUM(Products[rev])),,DESC)

then your desired

TopCategoryMeasure = calculate(
FIRSTNONBLANK(Products[Category_Name],1), 
FILTER(ALL(Products[Category_Name]),[RankMeasure]=1)
)

 


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

love u 

thanks!

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.