Forum Discussion
DAX: Puzzling ALL behaviour in context transition
- 7 years ago
Hi AlB and MattAllington
I did email Jeffrey Wang about this issue recently and he confirmed it is a bug and that it will be fixed in a future release. I don't have a timeframe, unfortunately.
Hi v-danhe-msft
There is no error. Both 'Test 1' and 'Test 2' work as you can see in the attached file. I am just trying to understand why the interaction between context transition and ALL() seems to be different in 'Test 1' than in 'Test 2'
Thanks
When a Table expression returns a single row and a single column..It can be used as a scalar.
So for example.You have a simple table (say Table1)
Column1
| 1 |
| 1 |
| 1 |
Lets define a Calculated Tableas ALL(Table1[Column1])
Since ALL returns unique values in a column/Table, above results in a Table of singlecolumn and single row containing 1
So now if you define even a MEASURE as following ..it will work
But if you change any one one value in the source table ..it will stop working
| 1 |
| 1 |
| 2 |
- AlB7 years agoCommunity Champion
Thanks Zubair_Muhammad
I understand that. My question has more to do with why the filter resulting from context transition has an effect on 'Test 1' but not on 'Test 2'.
Judging from the result, in 'Test 1' the filter resulting from context transition contains the value of ProductKey in the current row. That seems to override the ALL() to select only one value, a scalar, and it works. But following that reasoning, 'Test 2' should yield a 1 instead of 2517. as the ALL() is overridden by that one-row filter from context transition. It is that apparently different behaviour what I do not understand. What is your take on that?
Thanks