Forum Discussion
Finding value between dates
- Anonymous4 years ago
Hi jakub_klocek ,
Is the result in your screenshot the result you want? I have test by your data and code. I think it works well if you build a calculated column.
Order Table:
Price(2) Table:
Add a calcualted column in Order Table.
VK Neu = CALCULATE ( SUM ( 'Price(2)'[Old price] ), FILTER ( 'Price(2)', 'Price(2)'[Old from] <= 'Order'[DateNew] && 'Price(2)'[New from] >= 'Order'[DateNew] && 'Price(2)'[Product] = 'Order'[Product] ) )Output:
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sorry, my bad, only one Price(2) Table.
Hi jakub_klocek ,
Is the result in your screenshot the result you want? I have test by your data and code. I think it works well if you build a calculated column.
Order Table:
Price(2) Table:
Add a calcualted column in Order Table.
VK Neu =
CALCULATE (
SUM ( 'Price(2)'[Old price] ),
FILTER (
'Price(2)',
'Price(2)'[Old from] <= 'Order'[DateNew]
&& 'Price(2)'[New from] >= 'Order'[DateNew]
&& 'Price(2)'[Product] = 'Order'[Product]
)
)
Output:
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.