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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
SteveODea
Helper I
Helper I

RANKX measure including filtered out rows...

Can anyone help me with my DAX syntax?

 

I have created a measure which ranks the number of applications received across a range of academic programmes

 


Rank = RANKX(ALLSELECTED('Application Folder Advanced'[Academic Programme]),

[CountOfApplications],,DESC,Skip)
 

This works fine until I put a filter on the visualisation and the measure continues to rank

the number of applications, even though the count of applications is blank.
 
 
Untitled.jpg
 

What should my DAX look like so it only Ranks the visible items (I would've thought ALLSELECTED would

have taken care of this)?
1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@SteveODea 

Try:

 

Rank Count Values = IF([CountOfApplications] > 0, [rank], BLANK())

 

Or

 

Rank = RANKX(FILTER(ALL('Application Folder Advanced'[Academic Programme]), [CountOfApplications]> 0), [CountOfApplications],,DESC,Skip)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

8 REPLIES 8
PaulDBrown
Community Champion
Community Champion

@SteveODea 

Try:

 

Rank Count Values = IF([CountOfApplications] > 0, [rank], BLANK())

 

Or

 

Rank = RANKX(FILTER(ALL('Application Folder Advanced'[Academic Programme]), [CountOfApplications]> 0), [CountOfApplications],,DESC,Skip)

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thanks @PaulDBrown 

 

As ever a simple solution works the best! That was in my blind spot

 

The first one works perfectly.

 

No joy with the second.

 

Thanks for the feedback

Tad17
Solution Sage
Solution Sage

Hey @SteveODea 

 

I believe @amitchandak  is correct. But also check out the thread below for more information:

https://community.powerbi.com/t5/Desktop/RANKX-with-Slicers/td-p/69239

 

Also, check your CountOfApplication field in the visual field pane to make sure that "Show Items With No Data" is not selected.

 

If this helps please kudo.

If this solves your problem please accept it as a solution.

Thanks @Tad17 & @amitchandak 

 

I substituted ALL for ALLSELECTED but this did not work.

 

@Tad17  you mentioned the visual field panel...where is this exactly?

 

Also, my CountOfApplications measure is as follows:

 

CountOfApplications = DISTINCTCOUNT('Application Folder Advanced'[Reference Number])
 
but I do not encouter the filter problem when I just have this measure in my visualisaton...it's only when I include my Rank measure
 
Untitled.jpg
No blanks here!
 
It's probably something very simple, but I can't figure it out!

Hi @SteveODea ,

 

 Can you share your PBIX to us for further analysis if you don't have any Confidential Information?

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

@SteveODea 

 

The field pane is where you drag the values to be used in the visual. If you click the drop down arrow and you choose to show items with no data.

@Tad17 

 

Thanks but this only appears for my programmes column and is unchecked - this option does not appear for either of my measures...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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