Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create a Calculated Column to Sum Weekend Values

I have a date table that has calculated column counting all requests submitted on a given day. There are two KPIs that need to be tracked.  The first KPI is that each weekday has a capacity for 10 n...
  • Anonymous's avatar
    Anonymous
    3 years ago

    I think I have the answer.  I used a variable to get teh value of the previous row...

    Weekend Requests =
    var PrevDay = CALCULATE(
        SUM('Calendar'[Date on D2A]),
        DATEADD('Calendar'[Date],-1,DAY)
    )
    return
    IF('Calendar'[DayOfWeekNumber] = 7,
    'Calendar'[Date on D2A] + PrevDay
    )