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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bdehning
Post Prodigy
Post Prodigy

RANKX and Visual Filters

I use the following RANKX on a Table Visual.  

 

RANX =
RANKX(
'Prod DW - Business Policy Dimension',
'Prod DW - Business Policy Dimension'[EXMOD1]
)
 
How do I modify so that is takes into account the filters I have applied to my Table and not across all Column data.   
1 ACCEPTED SOLUTION
bdehning
Post Prodigy
Post Prodigy

I ended up applying filters to Prod DW - Business Policy Dimension in Power Query and then used my original RANKX and got results in Table Visual in needed.  Seemed it would be too hard to create measures for what I needed without doing that.   

View solution in original post

5 REPLIES 5
bdehning
Post Prodigy
Post Prodigy

I ended up applying filters to Prod DW - Business Policy Dimension in Power Query and then used my original RANKX and got results in Table Visual in needed.  Seemed it would be too hard to create measures for what I needed without doing that.   

Now that I use 

RANK =
RANKX(
'Prod DW - Business Policy Dimension',
'Prod DW - Business Policy Dimension'[EXMOD1]
)
 
I get ties for EXMOD1
 
bdehning_0-1675112301601.png

What do I need to add if I want to use POLICYESTIMATEDPREMIUM as my tie breaker?   Larger $ higher number?

 
 
amitchandak
Super User
Super User

@bdehning , This is column rank, It can not take the slicer filter, You can add filter in formula 

 

RANX =
RANKX(
filter('Prod DW - Business Policy Dimension','Prod DW - Business Policy Dimension'[Code] in {"1", "2"}
'Prod DW - Business Policy Dimension'[EXMOD1]
)

 

Or you have to create a measure rank

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

There is some syntax error and I think there is no closing ) somewhere, but I have tried to add it and not getting there,   

I got it to run, it needed ), after the filter.   I filter several things, so when I tried one of the filtered fields the Rank column returned all 1's. 

 

I have filters

GOVCLASS Text field = 5432

EXMOD1 Decimal Number field > 0

POLICYESTIMATEDPREMIUM General Field > 100000

 

RANX =
RANKX(
filter('Prod DW - Business Policy Dimension','Prod DW - Business Policy Dimension'[GOVCLASS] in {"1", "2"}),
'Prod DW - Business Policy Dimension'[EXMOD1]
)

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.