Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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 1Column 2Column 3Measure
AX1Added
AY2 
AZ2Added
AZ3Added
BX1Modified
BY1Modified
BY2 
BZ3 


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

  • 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())