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! Get ahead of the game and start preparing now! Learn more
Basically, my issue is that I want to loop through my entire dataset and see if my current date is between two other dates (both dates are columns in the dataset) and keep track of which ones are and which ones are not. I want to loop through and check the past thirty days. The dataset updates daily through a remote server so I want the 30 day range to start at the current day and go 30 days into the past and check the date ranges.
I have tried creating columns, but they only allow me to look at one day at a time and I cannot use the visual that my company wants and has been done using Excel. Each row has a lot of info, but the only columns we care about are the Queue start date, Queue leave date, and the stage of the process. Eventually, I want the sum of each stage on these 30 dates.
Solved! Go to Solution.
Hi @cbaumg
If you only want to keep the data of previous 30 days in the data model, you can filter rows in Power Query Editor. Expand the down arrow on the date column header and select Date Filters > In the Previous..., enter 30 days in the Filter Row dialogue. In this way, it starts from yesterday's data without today's data.
If you want to keep the current day as the start of previous 30 days, copy and paste below code into the formula bar.
= Table.SelectRows(PreviousStepName, each [Date] <= Date.From(DateTime.LocalNow()) and [Date] > Date.AddDays(Date.From(DateTime.LocalNow()),-30))
If you want to keep all data in the model but to show previous 30 days' data, you can apply a relative date filter on the date column in the report. Add a filter to a report in Power BI - Power BI | Microsoft Docs
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi @cbaumg
If you only want to keep the data of previous 30 days in the data model, you can filter rows in Power Query Editor. Expand the down arrow on the date column header and select Date Filters > In the Previous..., enter 30 days in the Filter Row dialogue. In this way, it starts from yesterday's data without today's data.
If you want to keep the current day as the start of previous 30 days, copy and paste below code into the formula bar.
= Table.SelectRows(PreviousStepName, each [Date] <= Date.From(DateTime.LocalNow()) and [Date] > Date.AddDays(Date.From(DateTime.LocalNow()),-30))
If you want to keep all data in the model but to show previous 30 days' data, you can apply a relative date filter on the date column in the report. Add a filter to a report in Power BI - Power BI | Microsoft Docs
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
@cbaumg Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 155 | |
| 131 | |
| 115 | |
| 79 | |
| 54 |