Forum Discussion
Why does a sorting column affect DAX measures?
Hi afaherty,
Yes, this can happen, and the reason is that Sort by Column is not purely cosmetic.
When you set:
Description
-> Sort by
-> Order SortPower BI can include both Description and Order Sort in the internal query used by the visual.
So even if your measure does not explicitly reference Order Sort, that column can still become part of the filter/grouping context in which the measure is evaluated.
This becomes especially noticeable with percentage measures that do something like:
ALL ( Table[Description] )or
REMOVEFILTERS ( Table[Description] )because that only removes the filter from Description.
The filter on Order Sort can still remain.
A common fix is to clear both columns together, for example:
CALCULATE (
[Your Measure],
REMOVEFILTERS (
'Grades'[Description],
'Grades'[Order Sort]
)
)or, if appropriate for the calculation:
CALCULATE (
[Your Measure],
ALL (
'Grades'[Description],
'Grades'[Order Sort]
)
)This is a known DAX pattern with Sort by Column. SQLBI has a good explanation of the issue in this article on Sort by Column and filter removal.
Microsoft’s Sort by Column documentation also confirms that the display column and sort column are tied together and must exist at the same granularity.
So I would not remove the sorting itself.
Instead, review any measure where you intentionally remove the Description filter and make sure you also remove the corresponding Order Sort filter when that is what the calculation logically requires.
That is why the numbers appear to change even though Order Sort is never referenced directly in the measure.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.