Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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
Hi @Hansolu
Thank you for reaching out to the Microsoft Fabric Community Forum.
We reviewed the scenario you raised regarding the ranking calculation not updating when certain articles are excluded or when different TopX selections are applied. We reproduced this behavior on my end using sample data and confirmed that the ranking now recalculates correctly, with the visuals updating dynamically based on the selected rank. To help you better understand the implementation and validate the approach, I’ve attached a sample PBIX file for your reference. Please review it and let me know your observations or if you notice any differences compared to your dataset.
Regards,
Microsoft Fabric Community Support Team.
scrap_pcs_rank =
RANKX (
ALLSELECTED ( dim_artikel ),
[scrap],
,
DESC,
DENSE
)
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
now the page filter is working but some other things are messed up
I use the rank to together with a parameter to select my ranked article. Then I show the details for this selected rank and a trend.
this measure for the selected rank and the charts are not good anymore.
For the period chart, the rankx should be calculated based on the time frame from the slicer. However, the chart should use the result of the rankx calculation but then apply the timeframe 30 days.
In other words, i want for the selected rankx a chart for the last 30 days, no matter what time was selected on the time slicer.
Do you know how i can fix this?
thanks
Get article at chosen rank (parameter):
Selected Article =
CALCULATE (
SELECTEDVALUE(dim_artikel[ArticleKey]),
FILTER (
ALLSELECTED(dim_artikel[ArticleKey]),
[scrap_pcs_rank] = SELECTEDVALUE(RankParameter[RankValue])
)
)
Trend measure (always last 30 days for that article):
Scrap Selected Rank (Last 30d) =
CALCULATE (
[scrap],
KEEPFILTERS(dim_artikel[ArticleKey] = [Selected Article]),
DATESINPERIOD(
dim_calendar[Date],
MAX(dim_calendar[Date]),
-30,
DAY
)
)
Ranking uses slicer timeframe,
Trend chart always locks to last 30 days for the selected rank’s article.
Hi, thanks but not sure how to do.
the measuere [Selected Article] is showing me the selected Rank.
the measuere [Scrap Selected Rank (Last 30d) ] is giving me an error
in addition, how can i use the Selected Articel in the visual to show only the selected articel and the breakdown of the scrap?
thanks\
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.
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |