The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
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
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.