Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
TonyEv6
Frequent Visitor

RANK and RANKX when the fact table is filtered by multiple dimensions

Does anyone have experience using the RANK and RANKX DAX functions when filtering across tables? A client wanting to display a list of organisations ranked by a variety of KPIs where the ranking needs to be filtered by up to four different dimensions - date, the selected KPI etc So, for example, we need to change the ranking based on date and the selected KPI.

 

Ranking works fine when the fact table is disconnected but once a dimension is added, a row context is forced and each of the entities gets a rank of 1. Tried various methods and DAX functions to force the measure to ignore row context but without success.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@TonyEv6 , When you add any other column in the visual that is not part of Rank/Rankx, the rank will redistributed or partitioned by the additional column

Refer: Impact of extra visual column on RankX| Why Rank 1 when added city id - https://youtu.be/t77bd57IVqk 

Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo

 

Assume you create a Rank

City Rank = RANKX(all(Geography[City]),[Sales])

 

and add city ID to visual i will give 1 for rank

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
TonyEv6
Frequent Visitor

Thanks. That makes sense. 

amitchandak
Super User
Super User

@TonyEv6 , When you add any other column in the visual that is not part of Rank/Rankx, the rank will redistributed or partitioned by the additional column

Refer: Impact of extra visual column on RankX| Why Rank 1 when added city id - https://youtu.be/t77bd57IVqk 

Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo

 

Assume you create a Rank

City Rank = RANKX(all(Geography[City]),[Sales])

 

and add city ID to visual i will give 1 for rank

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.