Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LFM
Helper III
Helper III

Automatically delete rows with expired dates

Hello.  I have a query that shows  trade date and exposure with deliver from and delivey to. Exposure show values and delivery to and from is dates. The table is connected to annother query with calender dates. I want to automatically delete all the rows that shows delivery to before todays date.

Trade dateExposureDelivery fromDelivery to
23.07.20242343242301.05.202431.05.2024
22.07.202432432401.07.202431.07.2024

The first row should then be deleted from the query. 

Is it possible to make this happen auctomatically as delivery date expires? 

2 ACCEPTED SOLUTIONS
AmiraBedh
Super User
Super User

You cannot delete data but you can use a column to filter your data. You can add a custom column to compare dates :

Date.FromText([Delivery to]) < Date.From(DateTime.LocalNow())

 Name it as IsExpired to use it as a flag, the result will be true or false.

Then in your table filter out expired rows by unchecking true.

Each time your dataset is refreshed you will not see these rows.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

Anonymous
Not applicable

Hi @LFM 

 

Power Query method:

Firstly filter by [Delivery to] column based on a specific date, then modify the formula like below in formula bar. Date.From(DateTime.LocalNow()) represents today's date. 

= Table.SelectRows(#"Previous step", each [Delivery to] >= Date.From(DateTime.LocalNow()))

vjingzhanmsft_0-1721872154117.png

If you want it to be updated every day, you need to refresh the report daily or set a schedule refresh to do that in Power BI Service.

 

 DAX method:

Create a measure like below and use it as a filter on the visuals where Delivery to is included. When you open the report, it will be updated. 

Measure = IF(SELECTEDVALUE('Table'[Delivery to])<TODAY(),0,1)

vjingzhanmsft_1-1721872646388.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @LFM 

 

Power Query method:

Firstly filter by [Delivery to] column based on a specific date, then modify the formula like below in formula bar. Date.From(DateTime.LocalNow()) represents today's date. 

= Table.SelectRows(#"Previous step", each [Delivery to] >= Date.From(DateTime.LocalNow()))

vjingzhanmsft_0-1721872154117.png

If you want it to be updated every day, you need to refresh the report daily or set a schedule refresh to do that in Power BI Service.

 

 DAX method:

Create a measure like below and use it as a filter on the visuals where Delivery to is included. When you open the report, it will be updated. 

Measure = IF(SELECTEDVALUE('Table'[Delivery to])<TODAY(),0,1)

vjingzhanmsft_1-1721872646388.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

AmiraBedh
Super User
Super User

You cannot delete data but you can use a column to filter your data. You can add a custom column to compare dates :

Date.FromText([Delivery to]) < Date.From(DateTime.LocalNow())

 Name it as IsExpired to use it as a flag, the result will be true or false.

Then in your table filter out expired rows by unchecking true.

Each time your dataset is refreshed you will not see these rows.


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors