Forum Discussion

jcawley's avatar
jcawley
Helper III
4 years ago
Solved

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...
  • tackytechtom's avatar
    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! 🙂

     

    /Tom
    https://www.tackytech.blog

    https://www.instagram.com/tackytechtom