In Power Bi, how to check table 1 column values are exist in table 2 or not, when there is no relationship between both tables?
Dataset schema details as below
Requirement:
Check left table ID column values are exist in Right Table EmpId column or not? if exist then update flag value in Left table with 1 else 0.
Let’s start with an example:
Step 1: Create calculated column in EmpTable, right click to data set name then click to New column.Step 2: Write Dax formula to check column values are exist or not
Flg =
IF ( EmpTable[ID]
IN DISTINCT (
ProductOrder[EmpId]), 1, 0 )
So here, we used three DAX
functions:- IF, DISTINCT & IN.
DISTINCT: Returns unique
Empid values from ProductOrder table.
IN: It will check
“EmpTable” ID column values are exist or not in ProductOrder Table.
IF: If Id’s are matched it
will return 1 else 0.
Output:
Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome
Comments
Post a Comment