Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |