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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Hansolu
Helper I
Helper I

Rankx working on visual but page filter not working

HI

 

I do have a quiet complex report. I one of the pages I do have a ranking of top 10 parts.

Thats all working fine.

scrap_pcs_rank = 
CALCULATE (
    RANKX (ALL(dim_artikel), [scrap] ),
    ALLSELECTED ( dim_calendar ),
    KEEPFILTERS(dim_artikel[ArticleKey]),
    ALLSELECTED ( dim_scrap_reason[Scrap Reason] )
)

the measure [scrap] is a simple sum, not filter or anything.

I can show my table with all Article, filter by e.g. top 10 rank, create another visuals and filter by the rank e.g. 1 and 2 and 3 to get 3 dynamic visuals based on the rank

 

Problem now is:

I do have some articles which I want to exclude from the rankx calculation by a filter on the page level for ArticleKey. 

If I exclude the rank 1 article on the page filter, my new table start with rank 2. I want to recalculate and the old rank 2 becomes the new rank 1. 

 

I tried to use the RANKX (ALLSELECTED(dim_artikel), [scrap] ) but then my initial top10 table is showing all numbers as the rank for each single article is 1 and therefore its showing all.

 

I am not sure what is wrong, why the page filter is not changing the rankx calculation 

 

Any ideas?

thanks

2 REPLIES 2
Shahid12523
Kudo Kingpin
Kudo Kingpin

Use this measure instead:

 

scrap_pcs_rank =
RANKX(
ALLSELECTED(dim_artikel[ArticleKey]),
[scrap],
,
DESC,
DENSE
)


Why?

 

ALLSELECTED(dim_artikel[ArticleKey]) keeps page filters (like ArticleKey filter)

Removes ALL(dim_artikel) which was ignoring page filter

Removes KEEPFILTERS(...) which was causing wrong rank = 1 for all

 

Result:
If you exclude an article on page filter → the rank recalculates → old rank 2 becomes new rank 1

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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