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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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