22.5 Relative Date and Relative Time Filters
Start with a problem
Zoya wants a page that always shows this month without editing the filter every month.
Explain simply
A relative date filter keeps dates relative to today (last N days, this month, last calendar month). A relative time filter works with minutes and hours.
Show the data
| Assume today is 06-May-2026 (IST) | Rows |
|---|---|
| Is in this month | 304–308 |
| Is in the last 1 months (calendar) | 301–303 (April) |
About this data: This table uses columns: Assume today is 06-May-2026 (IST), Rows. This table uses columns: Filter, Total Sales. This table uses columns: Filter type, Settings, Example. This table uses columns: Wrong result, Reason, Correction. Values shown are the lesson examples already on this page (not a new dataset).
Fictional sample data. Practice file: visuals_orders_apr_may_2026.csv (source: src/practice/).
Demonstrate
- Filters pane ›
Order Date› Filter type Relative date. - Show items when the value is in this › month › Apply.
- Change to is in the last 1 months (calendar).
Show the result
Your result should look like this (fictional sample):
| Filter | Total Sales |
|---|---|
| This month (May) | ₹1,200 |
| Last 1 calendar month (April) | ₹900 |
Explain what happened
Power BI calculates the date range from the current date at query time, so the page moves on by itself next month.
Explore further
- Check time-zone behaviour in the Service near midnight IST (see the reference below).
Detailed reference for this lesson:
| Filter type | Settings | Example |
|---|---|---|
| Relative date | Show items when the value is in the last / is in this / is in the next, a number, and a unit: days, weeks, weeks (calendar), months, months (calendar), years, years (calendar); Include today | Order Date is in the last 30 days; is in this month |
| Relative time | is in the last / this / next N minutes / hours | Order DateTime in the last 2 hours (near-real-time monitor) |
Calendar vs rolling
"Last 1 months (calendar)" = the whole previous calendar month (e.g. all of September). "Last 1 months" = a rolling window ending today. Also, relative filters use the current date/time at query time. Check the current documentation on time zones, karan an IST report viewed near midnight may behave differently in the Service.
Ravindra Bagale's Tip
Friends, pay attention: relative date filters use today's date, and students forget that the Service may evaluate "today" in UTC, which differs from IST around midnight. Also check whether "Last 7 days" should include today. Test relative filters after publishing, not only in Desktop. Try it once more, then move on.
Ravindra Bagale's Tip – मराठी
मित्रांनो, लक्ष द्या: relative date filters आजची date वापरतात, आणि students विसरतात की Service "today" UTC मध्ये evaluate करू शकतो, जो मध्यरात्रीच्या आसपास IST पेक्षा वेगळा असतो. "Last 7 days" मध्ये आजचा दिवस धरायचा का ते पण चेक करा. Relative filters फक्त Desktop मध्ये नाही, publish केल्यानंतरही test करा. पुन्हा एकदा करून बघा, मग पुढे जा.
Ravindra Bagale's Tip – हिंदी
दोस्तों, ध्यान दो: relative date filters आज की date इस्तेमाल करते हैं, और students भूल जाते हैं कि Service "today" को UTC में evaluate कर सकता है, जो आधी रात के आसपास IST से अलग होता है. यह भी check करो कि "Last 7 days" में आज शामिल होना चाहिए या नहीं. Relative filters को सिर्फ़ Desktop में नहीं, publish करने के बाद भी test करो. एक बार फिर करके देखो, फिर आगे बढ़ो.
Fix common mistakes
| Wrong result | Reason | Correction |
|---|---|---|
| Rolling 30 days used for last month | months vs months (calendar) | Use months (calendar) for whole months |
| Different result in the Service after midnight IST | Service may evaluate today in UTC | Test after publishing; add a buffer |
| FY quarter not available | Relative filter is calendar-based | Use a Date table with FY columns |
Practise independently
Practice task
If today were 15-Apr-2026, what would is in this month show?
Hints
- April rows.
Solution
301–303, ₹900.
Think like a professional
Relative filters remove monthly maintenance – but test them in the Service for IST users.
Revision card