Forum Discussion
DebbieStubbs67
3 years agoNew Member
Nested if statment with IN claus
Hi Iif i have a column with a list of codes, (eg A01, A02,A03, B01, B02, B03, C01, C02,C03), How would i create a sutom colum like if code in A01, A02,A03 then A Group if code in B01, B02, B...
- 3 years ago
Hi DebbieStubbs67
Hard coded method would beNew Column = SWITCH ( TRUE (), 'Table'[Code] IN { "A1", "A2", "A3" }, "A Group", 'Table'[Code] IN { "B1", "B2", "B3" }, "B Group", 'Table'[Code] IN { "C1", "C2", "C3" }, "A Group" )Other dynamic methods could also be possible but requires real examples.
tamerj1
Community Champion
3 years agoHi DebbieStubbs67
Hard coded method would be
New Column =
SWITCH (
TRUE (),
'Table'[Code] IN { "A1", "A2", "A3" }, "A Group",
'Table'[Code] IN { "B1", "B2", "B3" }, "B Group",
'Table'[Code] IN { "C1", "C2", "C3" }, "A Group"
)
Other dynamic methods could also be possible but requires real examples.
DebbieStubbs67
3 years agoNew Member
That is Spot on, Just what I need, Many Thanks