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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.