Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Relative filtering: Week before last week

Hi there   I have a time series i.e. a column of decimal numbers next to a column with dates. I would like a card that shows me four big numbers: - the sum of the last seven days (e.g. 5 September...
  • Stachu's avatar
    7 years ago

    you can calculate the intervals yourself with DATESBETWEEN, e.g.

    Last7days = CALCULATE(SUM('Data'[Value]),DATESBETWEEN('Calendar'[Date],TODAY()-6,TODAY()))
    
    Previous7days = CALCULATE(SUM('Data'[Value]),DATESBETWEEN('Calendar'[Date],TODAY()-13,TODAY()-7) )
    
    Last7daysly = CALCULATE(SUM('Data'[Value]),SAMEPERIODLASTYEAR(DATESBETWEEN('Calendar'[Date],TODAY()-6,TODAY())))
    
    Previous7daysLY = CALCULATE(SUM('Data'[Value]),SAMEPERIODLASTYEAR(DATESBETWEEN('Calendar'[Date],TODAY()-13,TODAY()-7)))