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.
Hello!
I have data that looks like this:
Product Sales Week
A | 3 | 202212 |
B | 3 | 202212 |
C | 202212 | |
D | 2 | 202212 |
E | 202212 | |
F | 1 | 202212 |
A | 2 | 202216 |
B | 202216 | |
C | 3 | 202216 |
D | 202216 | |
E | 1 | 202216 |
F | 202216 |
I want to have three different measures ("First", "Second", "Third") which will respectively show top 3 selling product based on Total Sales. With current data I should get following results from these 3 measures:
Since product A sells the most Measure "First" should return: A
Since product B & C sells second most Measure "Second" should return: B; C
And then measure "Third" should return: D
Any help is appriciated. Thanks!
/shamo
Solved! Go to Solution.
You can do this with a few measures. Firstly you need a ranking measure,
Sales Ranking = RANKX( ALL('Table'[Product]), [Total Sales],,,Dense)
and then to return the top product
First = CONCATENATEX( FILTER( VALUES('Table'[Product]), [Sales Ranking] =1 ), 'Table'[Product], ", ")
then the same for second and third
Works great! Thanks! 🙂
You can do this with a few measures. Firstly you need a ranking measure,
Sales Ranking = RANKX( ALL('Table'[Product]), [Total Sales],,,Dense)
and then to return the top product
First = CONCATENATEX( FILTER( VALUES('Table'[Product]), [Sales Ranking] =1 ), 'Table'[Product], ", ")
then the same for second and third
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |