cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

RANKX for a filtered subset

HI guys

 

Help needed! It is a very simple task that i need to achieve but my formula does not work, for unknown reasons.

 

I have a number of locations and need to filter for the top 10 locations with the most injuries but only for locations with more than a certain amount of actual worked hours (e.g. 30'000).

 

My approach is to first filter the LOCATION Dim Table with FILTER() and then do the RANKX by Injury. 

Here's my Formula so far:

Rank = 

RANKX(
    FILTER(ALL(DM_VW_LOCATION);[Actual Worked Hours]>=30000);
    CALCULATE([Total Injuries Rate];ALLEXCEPT(DM_VW_LOCATION;DM_VW_LOCATION[SiteCode]));;DESC;Dense)

 

Unfortunately the Measure still ranks locations below the 30'000 worked hours and provides very strange results:

airfreighter_0-1597647610801.png

There's no filter on that Matrix visualization yet, but my goal is to filter for Rank<=10 so that it only shows the top 10.

Any help? 

4 REPLIES 4
amitchandak
Super User
Super User
Anonymous
Not applicable

Hi @amitchandak 
Thanks for the link. I've gone through it but still don't know where things are going south. The filtering for the subset of locations does not seem to work.

did you get the solution?

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

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

Top Solution Authors