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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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