Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TSI
Advocate I
Advocate I

Find matching value in non-related table

Hi Community,

 

I'm new to DAX and struggling to do a 'vlookup' to find matching values in tables that are not related.

 

I'm working with 2 databases:

  • Master database - contains records of all employees in the company (i.e. Unique Employee ID)
  • Successor database - keeps track of employees (current position holder) and their successor.

Unfortunately the Successor database is quite messy, with records where Employee ID (Holder) = Employee ID (Successor), which is redundant data. I have added  a column "Is Real?" with Yes/No to differentiate the real successor  records.

Master databaseMaster databaseSuccessor databaseSuccessor database

 

 

 

 

 

 

 

 

 

 

 

Required solution:

To find out if an employee is also a successor, I want to add a "Is Successor" column in the Master database.

It needs to match the value of Employee ID + Month in the Master Database, to Employee ID (Successor) + Month (only looking at records where Is Real Successor = Yes) in Successor database.

Where it finds a match, to return "Yes", else "No":

Is Successor column (solution)Is Successor column (solution)
   
 
   
     
   
   
     

 

I've tried using Lookupvalue, but it didn't work because the relationship is between Master Database [Employee ID] and Successor Database [Employee ID (Holder)]. 

Using Query/Merge would be a more elegant solution, unfortunately it slows down the PBI desktop file considerably due to the huge Master database size.

 

Attached is the PBI file for reference.           


Many thanks in advance for your insights and guidance!

 

Best regards,

Kim

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

look at this article, it has examples for a measure that would use TREATAS/INTERSECT

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/
EDIT actually added the link to the article

 

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

look at this article, it has examples for a measure that would use TREATAS/INTERSECT

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/
EDIT actually added the link to the article

 

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

@Stachu 

 

Thanks! Would you have the link to the article please?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.