Forum Discussion
Show top 3 based on months using card visuals
I have a table as follow:
| Month | Destination | Value |
| October 2024 | Japan | 10 |
| October 2024 | Indonesia | 9 |
| October 2024 | Spain | 8 |
| October 2024 | Saudi Arabia | 4 |
| October 2024 | India | 3 |
| October 2024 | UK | 2 |
| September 2024 | Japan | 11 |
| September 2024 | Turkiye | 7 |
| September 2024 | Spain | 6 |
| September 2024 | Indonesia | 5 |
| September 2024 | UAE | 4 |
| September 2024 | US | 3 |
| September 2024 | Vietnam | 1 |
I'm struggling to create 3 card visuals showing top 3 Destinations based on Value. I also want to add a month slicer so that the viz will show the top 3 for specific months
For example, these are the top 3 for all months
And these are the top 3 for September only
I'm new to Power BI and I'd be thankful for any helps!
Create a measure:
Rank Destinations =
IF (
ISBLANK(CALCULATE(SUM('Table'[Value]))), // Check if Value is blank for the current context
BLANK(),
RANKX(
FILTER(
ALL('Table'), // Replace 'Table' with the actual name of your table
'Table'[Month] = SELECTEDVALUE('Table'[Month]) // Filter by current month
),
CALCULATE(SUM('Table'[Value])), // Rank by Value directly
,
DESC,
DENSE
))Add visual level, bottom 3 filter:
Let me know if this resolves the issue or if you need further assistance!
π If this helped, a Kudos π or Solution mark would be great! π
Cheers,
Kedar
Connect on LinkedIn
4 Replies
- Kedar_Pande
Super User
Create a measure:
Rank Destinations =
IF (
ISBLANK(CALCULATE(SUM('Table'[Value]))), // Check if Value is blank for the current context
BLANK(),
RANKX(
FILTER(
ALL('Table'), // Replace 'Table' with the actual name of your table
'Table'[Month] = SELECTEDVALUE('Table'[Month]) // Filter by current month
),
CALCULATE(SUM('Table'[Value])), // Rank by Value directly
,
DESC,
DENSE
))Add visual level, bottom 3 filter:
Let me know if this resolves the issue or if you need further assistance!
π If this helped, a Kudos π or Solution mark would be great! π
Cheers,
Kedar
Connect on LinkedIn- bluerobotRegular Visitor
Thank you, exactly what I was looking for! Another q, what visual is that to show all 3 result at once?
- Kedar_Pande
Super User