Forum Discussion
NoIdea
3 years agoRegular Visitor
Basic CALCULATE question OR a strange phenomenon
Hello, I have a question regarding the following simple Measure that does not give the result that I would expect. I would like to know if it is my lack of PBID / DAX understanding (I am new to i...
- 3 years ago
Have a look at this
https://www.sqlbi.com/articles/side-effects-in-dax-of-the-sort-by-column-setting/
NoIdea
3 years agoRegular Visitor
Meanwhile I have found the reason for this behaviour, but I have no explanation.
The result I get, depends on if the column which is part of the CALCULATE filter argument is being sorted by another column or not.
As an example, I have used a Contoso sample file.
The measures:
SumQuantity =
SUM( Sales[Quantity] )
SumQuantity May =
CALCULATE(
SUM( Sales[Quantity] ),
'Date'[Month] = "May"
)
The visuals without sorting the 'Date'[Month] column:
The visuals with sorting of the 'Date'[Month] column by Month Number:
An additional Visual combining both measures in a single measure:
Is there anyone out there who can explain this behaviour?
Is this normal?
Should columns not be sorted by other columns?