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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Matt78
Helper II
Helper II

How to find a valid purchase price according to posting date

Hi all,

 

I have 2 lists here, the one on the left is sales and the other one is a list of purcahse prices. As you can see, the prices changes some times and my issue here is that I would need to get a valid prices on the sales matrix whatever is valid on the certain posting date. I think I may have something wrong with my DAX because it leaves out July prices:

 

Purchace price =
var postingdate = max('Value Entries'[Posting Date])
var item_ = MAX('Value Entries'[Item No])
return
CALCULATE(MAX('Purchase Prices'[Price]), filter('Purchase Prices', 'Purchase Prices'[Ending Date] >= postingdate && 'Purchase Prices'[Starting Date] <= postingdate && 'Purchase Prices'[Item No] = item_))
 

Näyttökuva 2023-07-18 092548.jpg

Thank you for the help

 

 

Kind regards

Matti

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

https://1drv.ms/u/s!AiUZ0Ws7G26RiVzXTf7jI-hR6uCU?e=LI5Gso

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

View solution in original post

4 REPLIES 4
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

https://1drv.ms/u/s!AiUZ0Ws7G26RiVzXTf7jI-hR6uCU?e=LI5Gso

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Thank you for the quick solution, this was exactly what I was looking for 🙂

 

br

Matt

Ahmedx
Super User
Super User

Can you please share your demo input and expected output!

Hi,

 

Purchase price in the sales list should be 3,24 if posting date is 1.7. onwards, now it is empty.

 

br

Matt

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors