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
bp1894
New Member

How can I iterate through different tables to find a match and return values?

I'm new to Power Pivot/DAX and I'm trying to find a match from one column in Table 1 in another table, Table 2, and if a match is found, take another field from Table 2 and then try to find a match from that field to another Table, Table 3, and then return corresponding values from Table 3 back to Table 1.  If a match isn't found between Table 1 and Table 2, I want to be able to iterate to yet another Table, Table 4 and do the same thing - if a match is found in Table 4, then try to find a match with Table 3 and return corresponding values back to Table 1.  I have relationships built between these tables in the data model, but it's not working.  It looks like it only works if a match is found between Table 1 and Table 2.  If a match isn't found between Table 1 and Table 2, I can't get it to iterate to the next step.  Hope that makes sense.  I've tried using the CALCULATE function and USERELATIONSHIP within the CALCULATE function but can't get it to work.  Any help or guidance would be appreciated.

2 REPLIES 2
Anonymous
Not applicable

Hey @bp1894 ,
You can use RELATED and LOOKUPVALUE functions.
If it doesn't work as expected please share your expected output and pbix file after removing the sensitive data.

Markus_Re
Resolver I
Resolver I

Hi @bp1894,

 

could you provide a schematic of your current table / relationship setup?

 

Is the value you want to look up distinct or is it possible that there are multiple entries for the value in table2 / table4?

If the values are distinct you might even get away without using relationships by using the LOOKUPVALUE-Function. (https://docs.microsoft.com/de-de/dax/lookupvalue-function-dax

 

Best regards,

 

Markus

 

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

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.