Forum Discussion
Selectedvalue
- 1 year ago
Show me in a table(Excel) what you are trying to achieve
I created a measure for A,B and C, and I got the following table
If you need to see the empty lines, you have to tick: Show item with no data
- 1 year ago
In fact, you do not need dax to achive that
I just set up the following relationship
Then I added a matrix with the following parameters:Rows: Group (if you need from filter)
Columns: group_last_year
Values: Count of CUSTOMER_NUMBER
The blank line is for D et E value
If you use everything for the excel file you shared
Indeed, in you measure you have = "A" everywhere
SWITCH (
TRUE (),
SELECTEDVALUE ( Table1[Group] ) = "A",
CALCULATE (
DISTINCTCOUNTNOBLANK ( Table2[Customer] ),
FILTER ( Table2, Table2[Group] = "A" && Table2[Group_last_year] = "A" )
),
SELECTEDVALUE ( Table1[Group] ) = "A",
CALCULATE (
DISTINCTCOUNTNOBLANK ( Table2[Customer] ),
FILTER ( Table2, Table2[Group] = "A" && Table2[Group_last_year] = "B" )
),
SELECTEDVALUE ( Table1[Group] ) = "A",
CALCULATE (
DISTINCTCOUNTNOBLANK ( Table2[Customer] ),
FILTER ( Table2, Table2[Group] = "A" && Table2[Group_last_year] = "C" )
)
)
So only the first switch is used, I guess you have to replace the second SELECTEDVALUE ( Table1[Group] ) = "A", by B and the thirth by C
If it is not what you try to achieve, let me know
I want to count the customers from this year vs last year. How many customers in group A were in A last year, how many moved from A to B, ...
The visualzation should look like that:
| A last year | B last year | C last year | |
| A | 1 | 1 | 0 |
| B | 1 | 0 | 0 |
| C | 0 | 0 | 1 |