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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.