Forum Discussion
Create measure showing specified text when multiple other columns have particular values
Hi all,
Hoping this is a simple question - however I haven't been able to find what I need in other threads.
I have a large table of data with multiple columns, which I've simplified below:
I want to create a measure (or column?) with 2 values - Added and Modified - which appear based on certain criteria from other columns.
In the case below, the measure should show "Added" if:
Column 1 is A, Column 2 is X or Z, Column 3 can be anything
the measure should show "Modified" if:
Column 1 is B, Column 2 is X or Y, Column 3 is 1
| Column 1 | Column 2 | Column 3 | Measure |
| A | X | 1 | Added |
| A | Y | 2 | |
| A | Z | 2 | Added |
| A | Z | 3 | Added |
| B | X | 1 | Modified |
| B | Y | 1 | Modified |
| B | Y | 2 | |
| B | Z | 3 |
All the column values are text.
The reason I need this measure is to create some visuals which use "Added" and "Modified" in a legend - to count each of them.
Any help much appreciated.
Anonymous , A new column
Switch( True(),
[Column 1] = "A" && [Column 2] in {"X", "Z"} ,"Added",
[Column 1] = "B" && [Column 2] in {"X", "Y"} && [Column 3] =1 ,"Modified",
blank())
1 Reply
- amitchandak
Super User
Anonymous , A new column
Switch( True(),
[Column 1] = "A" && [Column 2] in {"X", "Z"} ,"Added",
[Column 1] = "B" && [Column 2] in {"X", "Y"} && [Column 3] =1 ,"Modified",
blank())