Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
86 | |
84 | |
83 | |
67 | |
49 |
User | Count |
---|---|
131 | |
111 | |
96 | |
71 | |
67 |