Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there,
I'm trying to get the shop with the most sales in a Card visualisation. But I don't know how do this.
The Sales column in this table is based on a measure.
So I want to have 'Berlijn' in the card.
Solved! Go to Solution.
Hi @Anonymous ,
I have done it in two ways.
1. Use the following formula to create measure:
Shop with the most sales =
MAXX ( FILTER ( 'Selling', [Sales] = MAXX ( 'Selling', [Sales] ) ), [Store] )
2. Use RANK() :
Use Rank =
CALCULATE (
MAX ( 'Selling'[Store] ),
FILTER ( 'Selling', RANKX ( ALL ( 'Selling' ), [Sales],, DESC, DENSE ) = 1 )
)
Here is the final outout:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'd like to launch something like Huffy, too (here are the huffy reviews from real clients, by the way). As for the solution of your problem, the previous commenter had already given the best advice as for me, I have nothing to add.
Hi @Anonymous ,
I have done it in two ways.
1. Use the following formula to create measure:
Shop with the most sales =
MAXX ( FILTER ( 'Selling', [Sales] = MAXX ( 'Selling', [Sales] ) ), [Store] )
2. Use RANK() :
Use Rank =
CALCULATE (
MAX ( 'Selling'[Store] ),
FILTER ( 'Selling', RANKX ( ALL ( 'Selling' ), [Sales],, DESC, DENSE ) = 1 )
)
Here is the final outout:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @Anonymous ,
You can created a calculated column as follows in Power BI:
flagCalc =
IF(tablename[Sales] = MAX(tablename[Sales]), "YES", "NO")
Then create a card visual and move STORE column to it. Under visual filters for thid card visual, move the above calculated flagCalc column and set it to "YES".
This will give you BERLIJN in the card visual.
Thanks,
Pragati
I get this error: The MAX function only accepts a column reference as the argument number 1.
No , Modeling -> New Column
Hi @Anonymous ,
Can you share your DAX please? I think you are missing some brackets.
I tried creating similar column and don't get any error:
Thanks,
Pragati
My sales is a measure and not in column.
You don't understand.. To calculate the sales.
HI @Anonymous ,
Apologies I missed that your SALES is a calculated measure.
You can create a Ranking column something like below:
rankCol = RANKX(ALL(tablename[Store]), [salesMeasure], , ASC, DENSE)
Now use this rankCol as a visual level filter in your card visual with STORE value in it and set it to display rankCol = 1
Thanks,
Pragati
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |