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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
johnmelbourne
Helper V
Helper V

RANKX query

Hi,

Below is my scenario. Any assistance would be greatly appreciated.

I have attached a pbix with the data.

One note I didn't include below was, doesn't rank A as has no services (is blank).

 

query.jpg

 

Filename Size URL Expires at

query.pbix
68.07 KB
https://tmpfiles.org/dl/922690/query.pbix
2023-02-09 07:49 UTC


Many thanks for viewers and attempted solutions.

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@johnmelbourne,

 

Try this solution.

 

Data model:

 

DataInsights_0-1675986845679.png

 

Measures:

 

Total Complaints = SUM ( FactTable[Total Complaints] )
Total Services = SUM ( FactTable[Total Services] )
Rank = RANKX ( ALLSELECTED ( FactTable ), [Total Complaints],, ASC )

 

Create a matrix using DimProvider[Provider] and the three measures. Add a visual filter:

 

DataInsights_1-1675987001005.png

 

Result:

 

DataInsights_2-1675987031611.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
DataInsights
Super User
Super User

@johnmelbourne,

 

Try this solution.

 

Data model:

 

DataInsights_0-1675986845679.png

 

Measures:

 

Total Complaints = SUM ( FactTable[Total Complaints] )
Total Services = SUM ( FactTable[Total Services] )
Rank = RANKX ( ALLSELECTED ( FactTable ), [Total Complaints],, ASC )

 

Create a matrix using DimProvider[Provider] and the three measures. Add a visual filter:

 

DataInsights_1-1675987001005.png

 

Result:

 

DataInsights_2-1675987031611.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Many thanks @DataInsights , I really appreciate your time and response. The visual filter is necessary I believe. I couldn't work out any other way. Thanks. 

John

@johnmelbourne,

 

Glad to hear that works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.