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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi
I have custom sorting order and found out that ALL(main field) doesn't change context within calculation (returns 1 instead of 7), and I have to explicitly put in ALL(sorting field).
Have somebody met this behaviour previously? Is this correct behaviour or error?
From my perspective, [order field] presents in table implicitly, just for sorting, and creating measure I can't foresee that somewhen somebody applied custom sorting, the custom sorting field might be even not created yet.
p.s. just checked - ALLSELECTED works the same way
Solved! Go to Solution.
Hi,
One of convenient ways to check which columns are involved in the filter context is to click "Run in DAX Query View" and check the query like below.
In this case, table visualization only contains month name column and sales column. However, query contains month number column as well because month name column is sorted by the month number column.
If month name column is not sorted by month number column, month number column will not be shown in the query.
Hi,
One of convenient ways to check which columns are involved in the filter context is to click "Run in DAX Query View" and check the query like below.
In this case, table visualization only contains month name column and sales column. However, query contains month number column as well because month name column is sorted by the month number column.
If month name column is not sorted by month number column, month number column will not be shown in the query.
Hello @vallemedef ,
This behavior is actually correct as per the DAX context rules in Power BI. When a custom sort field is applied, it becomes part of the filter context implicitly. To clear all context correctly, you must explicitly use ALL for both the main field and the sorting field.
Another example is when you use All function to remove context for months where if the months is sorted by month number than you should include both Month and month number in the All function
If you find this helpful , please mark it as solution and Your Kudos are much appreciated!
Thank You
Dharmendar S
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |