Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a very simple test table as below.
col1 | col2 | col3 | col4 |
A | 1 | t | 1 |
B | 2 | t | 2 |
C | 3 | k | 1 |
and three measures:
s1 := CALCULATE( SUM(Table1[col2]), ALLEXCEPT( Table1,Table1[col3]), FILTER( Table1, Table1[col4] = 1))
s2 := CALCULATE( SUM(Table1[col2]), FILTER( ALLEXCEPT( Table1, Table1[col3]), Table1[col4] = 1))
s5 := CALCULATE( SUM(Table1[col2]), ALLEXCEPT( Table1, Table1[col3]), Table1[col4] = 1)
I added [col1] and [col4] as the slicers and found:
If I selected B for the slicer [col1], s1 was blank and the other two got 1. Similar result would be got when I selected 2 for the slicer [col4].
I wanted to understand what the differences are among these measures. Thank you in advanced.
Solved! Go to Solution.
So when you explicitly filter for [Col2] = "B"
You are also generating crossfilters for the other columns on the second row of your table, so there are implied filters for:
[Col3] = "t"
[Col4] = 2
Given this the expression ALLEXCEPT( Table1,Table1[col3]) can be thought of as - Give me all rows where Col3 = "t"
For S1
For S3
For S5
Note: technically the engine does not process the results in terms of "rows", it deals with filter contexts on the various columns. It's just easier to explain this in terms of the rows of data in your example.
So when you explicitly filter for [Col2] = "B"
You are also generating crossfilters for the other columns on the second row of your table, so there are implied filters for:
[Col3] = "t"
[Col4] = 2
Given this the expression ALLEXCEPT( Table1,Table1[col3]) can be thought of as - Give me all rows where Col3 = "t"
For S1
For S3
For S5
Note: technically the engine does not process the results in terms of "rows", it deals with filter contexts on the various columns. It's just easier to explain this in terms of the rows of data in your example.
Hi d_gosbell, thanks for your prompt reply. It is very clear and easy to understand. Thank you !
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |