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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Andrewutter12
Frequent Visitor

Vlookups across two tables

Hello all,

 

I have two tables. Project table and debtors table. Both tables have matching unique transaction ID's. I'm looking to do some sort of vlookup to populate a project number on my debtors table.

 

Here's what I'm looking to achieve:

 

Project Table                                  Debtors Table

Trans ID          Project #              Trans ID   Project #

1                   20-24050               1                Blank

2                   20-24050               2                Blank

 

I want to populate a project # on my debtors table based on the matching trans ID's from each table.

 

Hope this makes sense.

 

Thanks!

1 ACCEPTED SOLUTION

@Andrewutter12 , an error arises when more than one result correspond to Debtors[Tranns ID New]. You may try this formula in a calculated column,

Column =
MAXX (
    FILTER (
        z_ISG_InFocusProjectQuery,
        z_ISG_InFocusProjectQuery[Trans ID New] = Debtors[Tranns ID New]
    ),
    z_ISG_InFocusProjectQuery[ProjectNumber]
)

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
AlB
Super User
Super User

Hi @Andrewutter12 

You can do this in PQ (probably better) or in DAX. In DAX the code for the Project# column in the debtors table would be:

Project# =
LOOKUPVALUE ( ProjectT[Project#], ProjectT[TransID], DebtorsT[TransID] )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Hello,

This is the error message I'm receiving when using that DAX.

Andrewutter12_0-1605296075196.png

Any thoughts?

@Andrewutter12 , an error arises when more than one result correspond to Debtors[Tranns ID New]. You may try this formula in a calculated column,

Column =
MAXX (
    FILTER (
        z_ISG_InFocusProjectQuery,
        z_ISG_InFocusProjectQuery[Trans ID New] = Debtors[Tranns ID New]
    ),
    z_ISG_InFocusProjectQuery[ProjectNumber]
)

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

This seemed to do the trick. Thank you so much for your help.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.