Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi,
I need some assistance in creating an IF statement in DAX using a lookup table.
Here is a sample of the main table:
Here is a sample of the lookup table:
Here is the output that I need. Column "Origin Check" will check whether any of the places matches with the "Lookup". It will return "Yes" if it matches, "No" if it does not match.
Same logic as "Origin Check" also goes for column "Destination Check". Return "Yes" if it matches, "No" if it does not match using the "Lookup" table.
Appreciate your kind assistance.
Thanks and best regards,
Mark V
Solved! Go to Solution.
Hi,
Use these calculated column formulas in the Main table. They will work even without a relationship between the 2 tables:
Origin check = if(isblank(lookupvalue('Table2'[lookup],'Table2'[lookup],'Table1'[Origin])),"No","Yes")
Destination check = if(isblank(lookupvalue('Table2'[lookup],'Table2'[lookup],'Table1'[Destination])),"No","Yes")
Hope this helps.
Thank you for the help guys!
Hi,
Use these calculated column formulas in the Main table. They will work even without a relationship between the 2 tables:
Origin check = if(isblank(lookupvalue('Table2'[lookup],'Table2'[lookup],'Table1'[Origin])),"No","Yes")
Destination check = if(isblank(lookupvalue('Table2'[lookup],'Table2'[lookup],'Table1'[Destination])),"No","Yes")
Hope this helps.
Hi @markefrody
Assuming no relationships, you create a calculated column in the 'Main Table'
Origin Check =
IF ( 'Main Table'[Origin] IN VALUES ( 'Lookup Table'[Lookup] ), "Yes", "No" )
Calc column = IF(RELATED('main table'[Destination])='Dim Table'[Destination]),"Yes","No")
you also need to create relationship between tables.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 24 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 44 | |
| 32 | |
| 18 | |
| 17 | |
| 17 |