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
Redacted_VAR
Helper I
Helper I

Get Axis Reference of Highest Value in Card

hi there,

 

I'm trying to achieve something that feels simple, but im really struggling.

 

I have a graph, in which totals the orders vs fruit, and i want a card that shows the fruit with the most orders (where # of orders is a measure)

 

Fruit# of Orders
Apples10
Oranges7
Pears4
  

 

now using Maxx(Values(Shopping[Fruit]),[#ofOrders])) gets me the correct number of orders, but shows as "10" instead of "Apples".

 

all i want to do is swap these values for each different basket. any help would be appreciated!

1 ACCEPTED SOLUTION
Redacted_VAR
Helper I
Helper I

Hey @jgeddes,

 

no need, with a slight amendment to your code I managed to find the solution:

 

Max Fruit = 
var _maxValue =
MAXX(Values(Shopping[Fruit]),[#ofOrders]))
Return
CALCULATE(
MIN(Shopping[Fruit]),
FILTER(Values(Shopping[Fruit]), [#ofOrders] = _maxValue)
)

 thanks so much for your help!

View solution in original post

4 REPLIES 4
Redacted_VAR
Helper I
Helper I

Hey @jgeddes,

 

no need, with a slight amendment to your code I managed to find the solution:

 

Max Fruit = 
var _maxValue =
MAXX(Values(Shopping[Fruit]),[#ofOrders]))
Return
CALCULATE(
MIN(Shopping[Fruit]),
FILTER(Values(Shopping[Fruit]), [#ofOrders] = _maxValue)
)

 thanks so much for your help!

jgeddes
Super User
Super User

Something like the following might work for you...

Max Fruit = 
var _maxValue =
MAXX(Values(Shopping[Fruit]),[#ofOrders]))
Return
CALCULATE(
MIN(Shopping[Fruit]),
FILTER(Shopping, [#ofOrders] = _maxValue)
)



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hey @jgeddes 

thanks for the suggestion, but that just returns a blank value, not the name of the fruit. i've checked to make sure i copied it across correctly. 

If you can share some sample data or dummy data that illustrates how your model is set up I can come up with a working solution for you.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.