Forum Discussion

elcabansh's avatar
elcabansh
Frequent Visitor
5 years ago
Solved

sum value for the previous 7 days

greeting  I try to do measure to give me the sum of planned values for the previous 7 days and it works planned_weekly1 = CALCULATE(SUM('cashflow+s-curve'[planned]),ALL('cashflow+s-curve'[planned]...
  • Jihwan_Kim's avatar
    5 years ago

    Hi, elcabansh 

    Please try the below for creating a new column.

     

    new column =
    VAR currentdate = 'cashflow+s-curve'[Date]
    RETURN
    SUMX (
    FILTER (
    'cashflow+s-curve',
    'cashflow+s-curve'[Date] <= currentdate
    && 'cashflow+s-curve'[Date] >= currentdate - 7
    ),
    'cashflow+s-curve'[planned]
    )

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM