Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I am trying to show Top and Bottom N categories and I have a Rankx measure for that. It works as it should when no filters are selected in the filter pane. However, when I filter by date, month, quarter, or uniqueid, the rankings are incorrect. I noticed that the filter context is ignored and it just keeps the ranking as it was before a filter was selected. I have tried different approaches but they all had different issues and gave me incorrect rankings when I selected a filter.
This is my measure to rank the Bottom categories:
Bottom Rank =
RANKX(
ALL(APIOperations[operationname]),
CALCULATE([TotalAPICalls]),
,
ASC,
DENSE
)
Any way to make it evaluate the filters before ranking?
My APIOperations Table looks like this and I have a date table connected to it.
Hi @Seyi38 ,
Maybe you should try ALLSELECTED instead of ALL function to create formula like below:
Bottom Rank =
RANKX(
ALLSELECTED(APIOperations[operationname]),
CALCULATE([TotalAPICalls]),
,
ASC,
DENSE
)TotalAPICalls =
CALCULATE (
SUM ( APIOperations[No.ofAPICALLs] ),
ALLEXCEPT ( APIOperations, APIOperations[OperationName] )
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Thanks for your solution.
My bad, I actually used ALLSELECTED() and not ALL as stated above.
I still encounter the same issue when trying your solution.
Bottom Rank =
RANKX(
ALLSELECTED(APIOperations[operationname]),
Calculate([TotalAPICalls]),
,
ASC,
DENSE
)
TotalAPICalls = CALCULATE (
SUM ( APIOperations[number_of_api_calls] ),
ALLEXCEPT(Dim_Dates,Dim_Dates[Month]) //I want to abe able to apply month filters
)Everything looks fine at first
When I select the month filter, I get blanck rows which it ranks as 1 from bottom and the actual operations for September gets a ranking from 2.
I guess this is because it's recognizing only the Month filter so it ranks blank operations as lower than 1 instead of excluding them entirely.
I only intend to ever filter by Month in the Dim_Dates table or uniqueID in the APIOperations table.
Measure Ignoring FIlters
you mean a calculated column?
No, measure.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |