Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have a table report with a relative date filter where I want to see orders that are in the previous 42 days re confirmed delivery date
I have turned this report into a query which I then use to create a csv file using 'Run a Query Against a Dataset'
I just want to make sure that the filter in the query is still a relative date filter and not hard coded to the current date.
VAR __SQDS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('Sales order'[Confirmed delivery date])),
AND(
'Sales order'[Confirmed delivery date] >= DATE(2025,1,10),
'Sales order'[Confirmed delivery date] < DATE(2025, 2, 20)
)
)
Solved! Go to Solution.
Hi @djm7 ,
Your DAX filter is currently hardcoded to the dates January 10, 2025 – February 20, 2025. This means it will not dynamically update based on the current date like the relative date filter in your Power BI report.
To ensure the filter remains dynamic (always showing the last 42 days including today), modify your DAX to use TODAY() instead of fixed dates:
VAR __SQDS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('Sales order'[Confirmed delivery date])),
'Sales order'[Confirmed delivery date] >= TODAY() - 42 &&
'Sales order'[Confirmed delivery date] <= TODAY()
)
This will dynamically adjust the date range based on the current date when the query runs, keeping it consistent with the relative date filter in Power BI.
Please mark this post as solution if it helps yopu. Appreciate Kudos.
thanks - kind of what I expected as it looked hardcoded and not variable.
Hi @djm7 ,
Your DAX filter is currently hardcoded to the dates January 10, 2025 – February 20, 2025. This means it will not dynamically update based on the current date like the relative date filter in your Power BI report.
To ensure the filter remains dynamic (always showing the last 42 days including today), modify your DAX to use TODAY() instead of fixed dates:
VAR __SQDS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('Sales order'[Confirmed delivery date])),
'Sales order'[Confirmed delivery date] >= TODAY() - 42 &&
'Sales order'[Confirmed delivery date] <= TODAY()
)
This will dynamically adjust the date range based on the current date when the query runs, keeping it consistent with the relative date filter in Power BI.
Please mark this post as solution if it helps yopu. Appreciate Kudos.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 22 | |
| 15 | |
| 10 | |
| 7 | |
| 4 |