Forum Discussion
Which DAX functions are correct?
- 3 years ago
Anonymous Well, no sane human being would construct that measure that way. All you need to do is MAXX(FilterSegment,[Transaction Size]). You have to read up on CALCULATE extremely closely to understand why this works: CALCULATE – DAX Guide. Some CALCULATE only DAX try hard worked overtime to get CALCULATE into that formula. It's utter nonsense. But, because CALCULATE evaluates the 'Transaction Size'[Transaction Size] within the context of FilterSegment, which is a single row table, then the DISTINCT brings back a single row table of the [Transaction Size] that happens to correspond to the context of the single row table in FilterSegment, which is whatever transaction size the sales happen to fall into. It's black box, stupidly complicated nonsense and doesn't have to be nearly that difficult or obfuscated. MSHGQM - Don't Use CALCULATE! - YouTube
Anonymous It's CALCULATE, ALL, FILTER although I would never construct that measure that way. I'm not even sure that the formula is actually valid or would even work as FILTER is going to return a table of values. Super awful DAX.
FILTER
Returns a table that represents a subset of another table or expression.
I do not understand why
CALCULATE
ALL
FILTER
is correct.
Why is the first CALCULATE?
'Transaction Size' is a table.
- Greg_Deckler3 years ago
Community Champion
Anonymous Well, those are the correct answers according to if you Reveal Solution. I'm not saying any of it is correct. It's all trash DAX imho. But, according to the site, those are the "right" answers:
- Anonymous3 years agoNot applicable
Greg_Deckler The given "correct" answer cannot be correct. This is why I am asking here if MY answer which I suggest in the original post is correct.
- Greg_Deckler3 years ago
Community Champion
Anonymous The right answer is to dispose of all of that DAX and start over.