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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
meepx
New Member

Approximate lookup of closest values

Hi Power BI Genius,

 

I'm having difficulty creating a DAX measure to retrieve approximate values from the two tables provided below.

 

Using the average cost of products sold in Table 2, I aim to find the shipment number with the closest unit cost received and the most recent shipment date received (if the unit costs received are the same in multiple shipments) from Table 1. 

 

Does anyone experience in creating something similar like this?

 

Table 1   
Shipment NumberShipment Date ReceivedProductUnit Cost Received
10005/12/2023A5.83
10011/01/2024B10.13
10022/03/2024C18.43
100318/02/2024B10.54
100417/02/2024C18.23
100529/02/2024A5.83
100610/04/2024B10.45
100715/04/2024C18.39
100820/05/2024A5.8

 

Table 2 
ProductAverage Cost sold
A5.825
B10.5
C18.23

 

Result wanted:

   
ProductAverage Cost soldApproximate Search for Shipment
A5.8251005
B10.51003
C18.231004
1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1716321242527.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

1 REPLY 1
ThxAlot
Super User
Super User

ThxAlot_0-1716321242527.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.