Forum Discussion
dynamic rolling date (last 7 days)
- 9 years ago
Hey Robertocarlos,
My apologies, I had the less than symbol backwards. It should be <=7 instead of >=7.
Use that calculated column and place it as a page-level filter with it's value set to 'Yes'. This should filter out everything except rows where the Date Column is in the last 7 days.
I don't see you calculating a measure. FILTER returns a table and could not be used as it does not return a scalar value in the filter context. I had a similar problem, where I needed the past 5 weeks, and used the CALCULATE function like:
SumKGpast5Weeks:=CALCULATE(Sum([QuantityWeight]),DimDate[WeekBeginDate]>=TODAY()-42)
In this case, I needed always the totals for the past 5 weeks from the beginning of the week. So I created a column with the week-begin for each date. You can of course change this to your expression, but you need to have a measure calculated.
For some reason it didn't work.
I tried the following formuila below to get only the dates between last 5 days,
TestDate Caluclated Column = DATESBETWEEN(table[TestDateTime (bins)],(TODAY()-5),TODAY())
but it would give me an error
A table of multiple values was supplied where a single value was expected.
I am simply trying to find a way so when the report is opened it defaults the date to last 5 days
| DateColumn | Column 1 | Column 2 | Column 3 |
| 11/15/2016 | 1 | 1 | 1 |
| 11/14/2016 | 0 | 2 | 0 |
| 11/13/2016 | 1 | 1 | 1 |
| 11/12/2016 | 1 | 0 | 1 |
| 11/11/2016 | 0 | 1 | 0 |
| 11/10/2016 | 1 | 1 | 1 |
| 11/9/2016 | 1 | 1 | 1 |
| 11/8/2016 | 0 | 2 | 0 |
| 11/7/2016 | 1 | 1 | 1 |
| 11/6/2016 | 1 | 0 | 1 |