Forum Discussion

electrobrit's avatar
electrobrit
Icon for Post Patron rankPost Patron
7 years ago
Solved

hours by day previous week

this seems so easy but my mind can't wrap my head around it. Trying to show how many hours spent doing certain tasks and compare to last week. 

I have used all kinds of formulas I'm finding and it's giving me totals whereas I want it by day so when i put in chart, I'm comparing week over week. 

  • Anonymous's avatar
    Anonymous
    7 years ago

    electrobrit,

     

    If you are trying to find the same day last week, then you can create a calculated columns as follow:

     

    Total Last week = VAR day_lastweek = DATEADD(Table11[Date],-7,DAY) RETURN
    CALCULATE(SUM(Table11[Total Hours]),
                FILTER(Table11,
                       Table11[Date] =day_lastweek))

    You will get this result:

     

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    Are you trying to return:

    • Total hours on the same day last week or
    • Total hours in whole previous week?

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    electrobrit,

     

    If you are trying to find the same day last week, then you can create a calculated columns as follow:

     

    Total Last week = VAR day_lastweek = DATEADD(Table11[Date],-7,DAY) RETURN
    CALCULATE(SUM(Table11[Total Hours]),
                FILTER(Table11,
                       Table11[Date] =day_lastweek))

    You will get this result: