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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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