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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
josborne
Frequent Visitor

Matching values in 2 table

Hi all.  I've looked for a similar solution ans wasn't able to find one.  Here's my question:

 

I have 2 tables imported into a BI model (Table1, Table2).  Each contains customer information and in my model I have them linked by Account#.  Using Table1 as my reference table, I would like to find matches from Table2 and return a couple of columns from Table2. Sample below, including a hypothetical 'Not Found'.

Additionally, I would like to control the data using dropdowns for financial year/month. I can't work out a way to make this possible.  For example the 'master' list of Table 1 would remain constant by the results from Table2 are affected by a filter.

 

Thanks for anyone who could assist.

 

josborne_0-1720490005149.png

 

James

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @josborne ,
Thank you @pdlv  very much for the solution, and I'll continue your line of thought and offer him specific advice:

After determining the relationship between the two tables, you can try to merge them into a single table for the operation.

MergedTable = 
ADDCOLUMNS(
   ALL('Table'),
   "Customer2",
    LOOKUPVALUE('Table (2)'[Customer],'Table (2)'[Account#],'Table'[Account#],"not found"),
    "Account2",
    LOOKUPVALUE('Table (2)'[Account#],'Table (2)'[Account#],'Table'[Account#],BLANK()),
    "Value2",
    LOOKUPVALUE('Table (2)'[Value],'Table (2)'[Account#],'Table'[Account#],BLANK()),
    "financialYear1",'Table'[FinancialYear])

vxingshenmsft_0-1720503579485.png

As for the second question you are trying to fulfill, I added years to your dataset to try to make what you need.

vxingshenmsft_1-1720503720066.png

Creating year tables that create links to merged tables can accomplish what you need.

FinancialYearTable = DATATABLE("Year",INTEGER,
{
    {2021},{2022}
})

vxingshenmsft_2-1720503780841.png

 

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 
 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @josborne ,
Thank you @pdlv  very much for the solution, and I'll continue your line of thought and offer him specific advice:

After determining the relationship between the two tables, you can try to merge them into a single table for the operation.

MergedTable = 
ADDCOLUMNS(
   ALL('Table'),
   "Customer2",
    LOOKUPVALUE('Table (2)'[Customer],'Table (2)'[Account#],'Table'[Account#],"not found"),
    "Account2",
    LOOKUPVALUE('Table (2)'[Account#],'Table (2)'[Account#],'Table'[Account#],BLANK()),
    "Value2",
    LOOKUPVALUE('Table (2)'[Value],'Table (2)'[Account#],'Table'[Account#],BLANK()),
    "financialYear1",'Table'[FinancialYear])

vxingshenmsft_0-1720503579485.png

As for the second question you are trying to fulfill, I added years to your dataset to try to make what you need.

vxingshenmsft_1-1720503720066.png

Creating year tables that create links to merged tables can accomplish what you need.

FinancialYearTable = DATATABLE("Year",INTEGER,
{
    {2021},{2022}
})

vxingshenmsft_2-1720503780841.png

 

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 
 

Thanks for that detail!  Very much appreciated.  So in your example, 'Table' is my 'Table1' and 'Table 2' is my 'Table2' right? 

Anonymous
Not applicable

Hi @josborne ,
I think so, all the data I'm using is operating on the data you've given me, so hopefully you'll be able to implement what you've got in mind.

Hope it helps!

 

Best regards,
Community Support Team_ Tom Shen

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 
pdlv
Helper I
Helper I

I think you should try to merge 2 table in to one then use the merged table to filter or caculate.

josborne
Frequent Visitor

OK thanks mate I'll give that a try.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors