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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
apantovic
New Member

RANKX not working with Filters on Visual

Hi all,

 

I'm building dashboard and I'd like to display the rank of the brand based on its market share.

The data looks like:

 

CategoryBrandValue
C1B110
C1B25
C1B31
C2B150
C2B210

 

Market share is calculated based on the Value column, and I'd have separate table for each category where filter on the each visual (table) would be different category.

 

I have a measure to calculate brand share but when I throw it in the RANKX function it returns me all the same values:

BrandRank = RANKX(ALLSELECTED('Data'), [BrandShare],,DESC, Dense)
 
I've also tried different variations like RANKX('Data', [BrandShare],,DESC, Dense) etc but I'm not sure what am I missing and why it's not working as expected. 
2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

These measures work

V = SUM(Data[Value])
MS = DIVIDE([V],CALCULATE([V],ALL(Data[Brand])))
Rank = RANKX(ALL(Data[Brand]),[MS],,DESC)

Hope this helps.

Ashish_Mathur_0-1692841323469.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
sergej_og
Super User
Super User

Hey @apantovic ,
something like this?

sergej_og_0-1692829961422.png

with applied filter:

sergej_og_1-1692830059988.png

Regards

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.