Forum Discussion

cgardyne's avatar
cgardyne
Icon for Helper I rankHelper I
9 years ago
Solved

Cumlative Total based on current axis date minus 60 days

I need a cumlative total based on the current axis date less 60 days. i.e today (29th May) is from 31st March - 29th May.   I have a table Date Sixty Days which contains a day for every day from to...
  • Phil_Seamark's avatar
    Phil_Seamark
    9 years ago

    Hi cgardyne

     

    For the last part of your question,  Just create a table with 1 column and three rows as follows:

     

    Date Range
    --------------
    30
    60
    90

    But don't create a relationship to any other table.  

     

    Create a measure on this table like 

     

    xyz = MIN('DateRangeTable'[Date Range])

    You can then create a slicer using this table and add the measure to your original formula

     

    So instead of Today - 60, you can use Today - [xyz]

  • Phil_Seamark's avatar
    Phil_Seamark
    9 years ago

    HI cgardyne

     

    I think I understand your need.  You need to sum up loans over a 60 day period (or dynamice period)

     

    you could try either this

     

    Property =
    CALCULATE (
        SUMX ( Loans, Loans[Amount] + Loans[Fee] )
            + 0,
        FILTER (
            ALL ( Loans ),
            Loans[User Sign Up Date] >= MIN ( 'Date Sixty Days'[Last Sixty Days] ) - 60
                && Loans[User Sign Up Date] <= MAX ( 'Date Sixty Days'[Last Sixty Days] ) 
                && Loans[LoanProductId] = 12
        )
    )

    or we could try using the DATESBETWEEN function.  Try this and let me know if the numbers look right