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

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

Reply
yuvara
Frequent Visitor

Join two tables in Power BI with a Key and between dates

Hi,

 

I am trying (struggling actually ...) to join two tables - Item Cost and Invoice, to get the Item Cost, per invoice.

Item Cost Table can hold different cost for different date periods for the same Item. And invoice table contains the Invoice ad Item info.

 

In SQL, I can join like : 

 

select
INV.Invoicenumber,
INV.ITEMID,
IC.Cost
FROM
InvoiceTable INV
outer left join Itemcost IC
on INV.Itemid = IC.Itemid
where
INV.Invoicedate >= IC.ItemCostStartDate
AND INV.Invoicedate < IC.ItemCostEndDate

 

is there any way, I can replicate this in Power BI way ? I.e. Merge queries or DAX ?

 

Thanks for your help.

1 ACCEPTED SOLUTION

@PattemManohar : I think this will fix my issue but I'm not able to test it becase I'm getting the below error (the tables are really huge):

"There's not enough memory to complete this operation. Please try again later when there may be more memory available."

 

I will re-try and let you know my feedback.

Thanks again !

 

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@yuvara It will be really helpful if you always provide sample test data and expected output, to suggest an accurate solution.

 

Anyway, here is the similar post that you are looking for.

 

https://community.powerbi.com/t5/Desktop/How-to-get-a-value-from-column-after-filtering/m-p/641805#M...





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

Proud to be a PBI Community Champion




@PattemManohar : I think this will fix my issue but I'm not able to test it becase I'm getting the below error (the tables are really huge):

"There's not enough memory to complete this operation. Please try again later when there may be more memory available."

 

I will re-try and let you know my feedback.

Thanks again !

 

yuvara
Frequent Visitor

Thanks ! It works !!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.