Short answer: a relative date slicer or filter keeps a period like "last 30 days" or "last 2 calendar months" current every day, without anyone changing it. Set a slicer's Style to Relative Date (or use the Date picker setting) and choose Last, Next or This, a number, and a unit. Rolling units (Months) end today; calendar units (Months (Calendar)) take only complete periods. The filter is calculated in UTC, and the date picker can anchor on Today, the last date in the data, or the first date.
"Last month" fixed to September is wrong on 1 November. A relative date slicer moves by itself, which is what dashboards opened every morning need.
Rolling or calendar?
Microsoft's example, on 20 July with "Last 2":
| Unit | Shows | Includes |
|---|---|---|
| Months | 21 May to 20 July | the current partial month |
| Months (Calendar) | 1 May to 30 June | only the two complete months |
The calendar units avoid comparing a half month with full ones. The units are Days, Weeks, Weeks (Calendar), Months, Months (Calendar), Years and Years (Calendar). This takes no number: "This month", "This year".
How do you create one?
- Add a Slicer with the date column (not the auto date/time hierarchy; switch the field to the column itself).
- Format visual, Slicer settings, Options, Style: Relative Date.
- Choose Last, Next or This, the number (for Last and Next) and the unit.
- As a filter instead: drag the date to the Filters pane (visual, page or all pages) and pick Relative date as the filter type.
The Date picker setting offers the same relative choices plus a calendar and a slider for exact dates, and three anchors:
- Today: the range counts from the day the report is viewed (as the Relative Date style).
- Last date: from the latest date in the column, useful when the data lags behind (yesterday's load, last month's close).
- First date: from the earliest date in the column.
What about times and time zones?
The relative time slicer and filter work on date-time columns for windows like "last 60 minutes", often with automatic page refresh. On a page or report level, all visuals use one shared anchor time so they show the same window; it is set on page load, manual refresh, automatic refresh and model changes.
Both relative date and time filters use UTC: a model does not store time zones. A viewer in Vienna (UTC+1 or +2) at 00:30 sees "today" still as yesterday. If that matters, shift the dates into your time zone in Power Query, or use a DAX filter on local time.
Can DAX do the same?
When the period must be in a measure (a card that says "last 30 days" regardless of slicers), filter in DAX:
Revenue Last 30 Days =
CALCULATE (
[Revenue],
DATESINPERIOD ( 'Date'[Date], TODAY (), -30, DAY )
)
Revenue Last 2 Full Months =
VAR EndPrev = EOMONTH ( TODAY (), -1 )
RETURN
CALCULATE ( [Revenue], DATESBETWEEN ( 'Date'[Date], EOMONTH ( EndPrev, -2 ) + 1, EndPrev ) )On 20 July, the second returns May and June, as the calendar slicer does. A calculated column on the date table makes a reusable flag:
Is Last 30 Days =
'Date'[Date] > TODAY () - 30 && 'Date'[Date] <= TODAY ()TODAY in a calculated column is evaluated at refresh, so the flag moves only when the model refreshes; in a measure it is evaluated at query time.
What goes wrong?
- Half a month compared with full ones. Use the calendar units for month-over-month views.
- Data that lags. "Last 7 days" from today shows an empty day if yesterday's data is not loaded yet; use the Last date anchor.
- UTC surprises. Around midnight, "today" is UTC's today; shift times in the model if needed.
- The auto date hierarchy. The relative style needs the date column itself.
- Publish to web. Relative time filters are not supported there.
Where can you check this?
- Microsoft Learn: Create a relative date slicer and filter in Power BI
- Microsoft Learn: Create a relative time slicer or filter in Power BI
- Microsoft Learn: DATESINPERIOD function (DAX)
- Microsoft Learn: EOMONTH function (DAX)
Where do you start?
Give the main page a relative date slicer with a calendar unit and, if the data lags, the Last date anchor. Rolling 12 months in DAX builds the same windows inside measures.