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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DuaneDLB
Helper I
Helper I

Add value from one table Power BI table to another based on two column conditions

I have two tables '1' and '2' (see diagram below).

Table1 contains a list of detail orders with a Source and Price.  I would like to add a new column to Table1 called 'Value'.  The value will be populated using the value from Table2. 

 

I need to use the Source and Price from Table1 and look up the value in Table2.  I have no problems doing a Lookupvalue when the column is a one to one match, but in this case I have to match on the Source and the Beg Price and End Price in Table2.

 

Both tables have 'Source' to match on, but trying to select the record where the Price from Table1 is assoicated to the Beg Price and End Price of Table2.  Once I find the match in Table2 I would like to store the value into the new column in Table1.   Any suggestions?  Thanks 

 

DuaneDLB_0-1656360035425.png

 

 

 

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @DuaneDLB ,

 

Please create the new column.

 

Value = 
CALCULATE (
    SUM ( Table2[Value] ),
    FILTER (
        Table2,
        Table2[Source] = EARLIER ( Table1[Source] )
            && Table2[Beg Price] <= EARLIER ( Table1[Price] )
            && Table2[End Price] >= EARLIER ( Table1[Price] )
    )
)

vkkfmsft_0-1656574231483.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @DuaneDLB ,

 

Please create the new column.

 

Value = 
CALCULATE (
    SUM ( Table2[Value] ),
    FILTER (
        Table2,
        Table2[Source] = EARLIER ( Table1[Source] )
            && Table2[Beg Price] <= EARLIER ( Table1[Price] )
            && Table2[End Price] >= EARLIER ( Table1[Price] )
    )
)

vkkfmsft_0-1656574231483.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

danextian
Super User
Super User

Hi @DuaneDLB ,

 

You can do a merge in Power Query to a table from another table. Under Join Kind, select Left outer. This will return all rows in Table with matching rows in Table1. A new column containing tables will be created after the merge. You may expand this and select only the needed/desired columns.

danextian_1-1656371320976.png

danextian_3-1656371437374.png

 

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors