Forum Discussion
Tiyani
Helper I
1 year agoRelative date and Date slycer
Hello everyone,
I want my power BI report page to show the past 7 days by default (I've done this using relative date) but I also want the same report page to be filtered with a date slicer with dates outside the range of the past 7 days. I cannot seem to get the date slycer filter and relative date filter (default view) to not affect each other, how can I achieve this.
You'll need a column to distinguish what's within and beyond seven days. Use that column in a slicer. Please see attached pbix.
3 Replies
- danextian
Super User
Hi Tiyani
In your calendar table, you will need to create a column that distguishes which dates are within and beyond seven days with a reference to a specific date - today or max transaction date. An example calculated colum would be:
VAR ReferenceDate = TODAY () --or MAX(datatable[date]) RETURN --includes the reference date and 6 days earlier for a total of 7 days IF ( CalendarTable[Date] >= TODAY () - 6, "Past 7 days", "Beyond 7 days" )