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
shaebert
Helper III
Helper III

Using RANKX and ALL but need to filter out values

I found this Dax from https://community.powerbi.com/t5/Desktop/display-Rank-on-a-Card-visualization/m-p/168064

 

OVERALL_RANK = RANKX(
		ALL(Sales[Store]);
		CALCULATE(
			SUM(Sales[Sales])
			 )
		    )

 

To help with my challenge. I was able to edit it to this: 

 

OVERALL_RANK = RANKX(
		ALL(MasterTable[Campaign Location]),
		CALCULATE(
			[Opps Created])
			 )
		    )

 

 This spits out the following:

 

Screen Shot 2023-05-09 at 4.26.57 PM.png

 

This is great, but I don't want to include Admin, HBS, and Unknown row. IL should be 1, IA should be 2, etc. 

 

Does anyone know what I can do to edit the Dax to get the result I am looking for?

1 ACCEPTED SOLUTION
shaebert
Helper III
Helper III

I figured this out with a work around. For the "Opps Created" measure, I created a new measure that had a calculated filter, filtering out the values I didn't want to include in the RANKX. 

View solution in original post

3 REPLIES 3
shaebert
Helper III
Helper III

I figured this out with a work around. For the "Opps Created" measure, I created a new measure that had a calculated filter, filtering out the values I didn't want to include in the RANKX. 

amitchandak
Super User
Super User

@shaebert , I am assuming this a measure rank and Opps Created is a measure

 

Have tried allselected?

 

OVERALL_RANK = RANKX(
ALLSELECTED(MasterTable[Campaign Location]),
CALCULATE(
[Opps Created])
)

Yes, I tried that, but it won't work, because I forgot to mention that I am trying to visualize just one of the regions and their ranking in a card visual.

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.