March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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 |
Apples | 10 |
Oranges | 7 |
Pears | 4 |
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!
Solved! Go to Solution.
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!
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!
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)
)
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.
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |