Forum Discussion
drrai66
Resolver I
8 years agoReturn a new Column in Table 1 By Comparing a Column In 2 Tables
Hi Experts, I am on learning curve for Power BI but a heavy user of Tableau. I need your help in this situtaion: I have 2 Tables as Follows and both of These Tables are Related on ID Table1 ...
- Anonymous8 years ago
Try this:
Column = SWITCH ( TRUE (), AND ( Table1[ID] = RELATED ( Table2[ID] ), Table1[Eligibility] = "Eligible" ), "Yes", Table1[Eligibility] = "Eligible", "No", AND ( Table1[ID] = RELATED ( Table2[ID] ), Table1[Eligibility] = "N/A" ), "Yes", "N/A" )This pattern is the same as a nested IF statement:
SWITCH(TRUE(),
Condition1 being true, Result1,
Condition2 being true, Result2,
...,
Result if everything is false
)
Use AND() to join to logical statements.
Use RELATED() to get the value in the related tables column (roughly similar to a VLOOKUP in Excel)
drrai66
Resolver I
8 years agoHi Chris,
This Would Work, I know, but the thing is that those numbers are repeating in my Table 2, so I have One to Many Relationship between Table 1 and Table 2 In My data, So When I write your Calc, I don't get the Name of Table 2 . Any Work Around for this?
Thanks
Deepak
drrai66
Resolver I
8 years agoHi Chris,
Using the Logic in here, I am able to Solve.
I first Created a Column in Table 1 and Then Used your Logic to Solve it.
Thanks
and Regards
Deepak