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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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