cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User
Super User

@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
Super User
Super User

@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

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

amitchandak
Super User
Super User

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!