Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 18 | |
| 12 | |
| 11 | |
| 6 | |
| 6 |