Forum Discussion
jcawley
4 years agoHelper III
Date Spread Measure
Hello all, My goal is to have a measure that sums payment amounts based on the spread of two dates, across two different tables. Purchase table: Customer ID Purchase Date 555 1...
- 4 years ago
Hi jcawley ,
I think I got to a solution:I pressumed there is a one to many relationship from purchase to payments. I also reckon that the key to create the connection on is not Customer but maybe Order? Yet, I joined on Customer anyway for the sake of this example 🙂 :
Here is the measure I created:
TomsPaymentMeasure = CALCULATE ( SUMX ( Table16b, [Payment Amount]), FILTER ( Table16b, Table16b[Payment Date] -30 < RELATED ( Table16a[Purchase Date] ) ) )Hope this helps! 🙂
tackytechtom
4 years agoMost Valuable Professional
Hi jcawley ,
I think I got to a solution:
I pressumed there is a one to many relationship from purchase to payments. I also reckon that the key to create the connection on is not Customer but maybe Order? Yet, I joined on Customer anyway for the sake of this example 🙂 :
Here is the measure I created:
TomsPaymentMeasure =
CALCULATE (
SUMX ( Table16b, [Payment Amount]),
FILTER ( Table16b, Table16b[Payment Date] -30 < RELATED ( Table16a[Purchase Date] ) )
)
Hope this helps! 🙂