Forum Discussion
powerbihelp87
Helper V
5 years agoIf statement more than one table
I need help with multiple table If statement, I tried to give sample tables below. If Column Code=100 then the new column should be XYZ else if the Column is Grp is 8fni then it should be ABC, the ...
- 5 years ago
Hey powerbihelp87 ,
yes, you can write it like that:
DAX Help Column = SWITCH( TRUE(), 'Table 1'[Code] = "100", "XYZ", RELATED( 'Table 2'[Grp] ) IN { "8fni", "8vhi", "0kis" }, "ABC", "EFG" )By the way, always link someone in an answer like that: powerbihelp87
Otherwise I won't get a notification that you answered.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
powerbihelp87
Helper V
5 years agoThanks Denis!
Do you know how I can write the syntax if there are multiple options for this portion:
RELATED( 'Table 2'[Grp] ) = "8fni"
For example if any of these from Grp field: "8fni" or "8vhi" or "0kis" THEN it is ABC
selimovd
Most Valuable Professional
5 years agoHey powerbihelp87 ,
yes, you can write it like that:
DAX Help Column =
SWITCH(
TRUE(),
'Table 1'[Code] = "100", "XYZ",
RELATED( 'Table 2'[Grp] )
IN {
"8fni",
"8vhi",
"0kis"
}, "ABC",
"EFG"
)
By the way, always link someone in an answer like that: powerbihelp87
Otherwise I won't get a notification that you answered.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic