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.
I have column chart the x is date and the y is max of a numberic, the legned is the object type(contain 25 types every day). I only want to show object type of the top 3 y value
Solved! Go to Solution.
Sample Table
Category | Product | Sales |
A | A1 | 200 |
A | A2 | 250 |
A | A3 | 300 |
A | A4 | 350 |
A | A5 | 400 |
B | B1 | 450 |
B | B2 | 500 |
B | B3 | 550 |
B | B4 | 600 |
B | B5 | 650 |
B | B6 | 700 |
SalesValue = SUM(CPS[Sales])
Rank =
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank
Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
It's working for me. But why distance of each columns are too far and not aligned?
@shaowan You could try TopN visual level filter.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Thanks but that's not I want, I want to show top 3 types in every date.
You have to create one measure for ranking.
Refer to this- https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
If you are still confused, please share your sample table and expected output.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Sample Table
Category | Product | Sales |
A | A1 | 200 |
A | A2 | 250 |
A | A3 | 300 |
A | A4 | 350 |
A | A5 | 400 |
B | B1 | 450 |
B | B2 | 500 |
B | B3 | 550 |
B | B4 | 600 |
B | B5 | 650 |
B | B6 | 700 |
SalesValue = SUM(CPS[Sales])
Rank =
var _selectedCategory= SELECTEDVALUE(CPS[Category])
var _rank=RANKX(FILTER(ALL(CPS),CPS[Category]=_selectedCategory),[SalesValue])
return _rank
Now apply the visual level filter. (show item when the value: Rank is less than or equal to 3)
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
Thanks so much, it fixs my problem!
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 |
---|---|
96 | |
93 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |