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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Vvitikin
Regular Visitor

Selecting the price in the last invoice for a particular part (Invoice Header and Invoice Detail)

Hello, Community. I apologize if I can't express my question properly or my pictures aren't as nice as others. It's my first post here.

I have a table "Table of Sales Head" that contains the "Invoice date" and the "Invoice number". The second table is "Table of Sales Detail" that contains the "Invoice number", the "Part Number" and the "Invoiced Price"

Both tables contain an "Index Key"

I want to select the price of a part as listed in the last invoice. The ultimate goal is to build a report (table) that will look like the one posted below.

I have tried many DAX formulas suggested in different forums but everyone seems to have a problem different than mine!

 

Vvitikin_3-1715718207381.jpeg

Vvitikin_4-1715718250594.jpeg

 

 

Vvitikin_2-1715718161556.png

 

 

Vvitikin_1-1715718119262.png

 

2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi @Vvitikin ,
Based on your description, you want to display data from different tables in the same table, noting that you have created some relationships. However, the relationship between Table of Sales Dtl and Part, Erp Customer and Table of Sales Dtl tables is not clear so that I can't help you well based on the existing conditions. Please provide detailed test data or pbix file, please hide sensitive information in advance.

 

Best regards,
Albert He

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

Albert, Thank you very much for the response. I apologize for not being more clear. I have attached a pbix (Last Invoice date.pbix)  for your consideration. I have found a solution using the last invoice number as max to get the price of the part in the lastest invoice, but I need the formula to be based on the date of the invoice. I have tried with LASTESDATE but I don't get a result. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.