Forum Discussion
Find value in selected date range
Hi.
I am trying to create a report showing the development in purchase prices over a given period. In inclosed report, I have the purchase prices in one table and a date table.
When I select a period (based on date table) from March 12 2021 - March 30 2022 I would like to see all puchase prices in this period. However, if I have a purchase price valid from January 1 2021 - April 30 2021 this price wont show in the report as the start date for the price is before the start date in the date table.
How can I solve this? The price is valid on March 12...
Pls. see enclosed file - I have used article "Test 4" in above description.
Thanks a lot in advance.
Helen
https://drive.google.com/file/d/1JPi7d8ico4m6flDDrL_UzM0nQAs9L2eG/view?usp=share_link
2 Replies
- mangaus1111Solution Sage
Hi Anonymous ,
try this measure maybe it works:
PricePerStartOfMonth =VAR c_date = SELECTEDVALUE ( 'Date'[Date] )VAR MinDate= MIN('Date'[Date])RETURNCALCULATE (MAXX (FILTER('Historic_Gross_Price','Historic_Gross_Price'[Valid from] >= MinDate),'Historic_Gross_Price'[Price]),c_date >= 'Historic_Gross_Price'[Valid from],c_date <= 'Historic_Gross_Price'[Valid to])If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable