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
Hi, yes true. This measure is only for A. I have another measure only for B and C.
- Cookistador1 year agoSuper User
But your measure for A is wrong, only the first case will be evaluated as you do not have other condition than Table1[Group] = "A"
What you should do is something like:
Mymeasure =
Switch(TRUE(),
Table1[Group] = "A",MeasureForA,
Table1[Group] = "B",MeasureForB,
Table1[Group] = "C",MeasureForC)
- Anonymous1 year agoNot applicable
so my measure is totally wrong for what I need 😣
- Cookistador1 year agoSuper User
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