Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi All,
I have a need to basically filter data that has a date field called 'created_at'. Basically I need to somehow filter data from today's date-7 days with respect to the 'created_at' date field. Also, today's date would be dynamic in nature so for example if today's date is 3/11/2022 then upon filtering data, it should display from 3/4 till today for the table that has 'created_at' field. Come tomorrow, it would be from 3/5-3/12 so it should have the ability to change today's date dynamically. Can someone please suggest a solution in this case, thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
If you only want to import last 7 days data into your model, @Vera_33 's solution will work. But this will not happen automatically. In Power BI Desktop, you need to click on Refresh button in Home ribbon to reimport the latest 7 days data. If you have published the report to Power BI Service, you should set a scheduled refresh for the dataset to refresh data every day. In this way, it will update the report to have latest 7 days data.
You can also use the User Interface to filter rows based on date type column. Filter by values in a column - Power Query | Microsoft Docs
If you want to load all data into the model but filter a date column on a visual (or on a report page, or on the whole report), you can use the relative date filter in filter pane or use relative date slicer. Use a relative date slicer or filter in Power BI - Power BI | Microsoft Docs This would update automatically every time you open the report.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
If you only want to import last 7 days data into your model, @Vera_33 's solution will work. But this will not happen automatically. In Power BI Desktop, you need to click on Refresh button in Home ribbon to reimport the latest 7 days data. If you have published the report to Power BI Service, you should set a scheduled refresh for the dataset to refresh data every day. In this way, it will update the report to have latest 7 days data.
You can also use the User Interface to filter rows based on date type column. Filter by values in a column - Power Query | Microsoft Docs
If you want to load all data into the model but filter a date column on a visual (or on a report page, or on the whole report), you can use the relative date filter in filter pane or use relative date slicer. Use a relative date slicer or filter in Power BI - Power BI | Microsoft Docs This would update automatically every time you open the report.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
You want to filter the date prior to load to model using Power Query, right? Filter the [created_at] >= Date.AddDays( Date.From(DateTime.LocalNow()),-7)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
111 | |
62 | |
53 | |
38 |