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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
I_LOVE_POWER_BI
Helper III
Helper III

Show me the name of the MIN/MAX value

Hi folks, My problem appears to be very simple: 

 

I have a MIN and a MAX value - easy. But how can I show the name of the category of the MAX/MIN value? Here an example:

I_LOVE_POWER_BI_0-1623302847455.png

 

So depending on the MIN/MAX value in column "Weight", I want the column value in "Receipe" to appear.

 

Thanks!!

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

RECIPE Max =
MAXX( TOPN( 1, 'DATA TABLE', 'DATA TABLE'[Weight] ), 'DATA TABLE'[RECIPE] )
RECIPE Min =
MAXX( TOPN( 1, 'DATA TABLE', 'DATA TABLE'[Weight], 1 ), 'DATA TABLE'[RECIPE] )

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

5 REPLIES 5
CNENFRNL
Community Champion
Community Champion

RECIPE Max =
MAXX( TOPN( 1, 'DATA TABLE', 'DATA TABLE'[Weight] ), 'DATA TABLE'[RECIPE] )
RECIPE Min =
MAXX( TOPN( 1, 'DATA TABLE', 'DATA TABLE'[Weight], 1 ), 'DATA TABLE'[RECIPE] )

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

amitchandak
Super User
Super User

@I_LOVE_POWER_BI , Try meausre like

 

Switch(true(),
Max(Table[Receipe]) = "Orange Cake", min(Table[Weight]),
Max(Table[Receipe]) = "Apple Cake", max(Table[Weight])
)

 

or

 

 

sumx(values(Table[Receipe]),
Switch(true(),
Max(Table[Receipe]) = "Orange Cake", min(Table[Weight]),
Max(Table[Receipe]) = "Apple Cake", max(Table[Weight])
)
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks @amitchandak ,

 

I didn't explain it well enough, sorry. The two cakes are just an example out of a lot of different variables. I need it to be dynamically, not based on those two fixed values.

 

So the measure has to first lookup the MIN value and then show the name of the respective receipe. How to da that?

@I_LOVE_POWER_BI ,Can you share sample data and sample output in table format?

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak thanks for your kind support. So here is the example, which shows how easy my request actually is: 

I_LOVE_POWER_BI_0-1623315720825.png

I have a card in which I want to show "Orange Cake", because it is the Max-value. As you can see in the filter ribbon, this must be dynamic, because depending on the receipe I choose, I want to see which is the receipe name with the highest value. 

 

Thanks again!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.