Forum Discussion
Automatically delete rows with expired dates
- 2 years ago
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.
- Anonymous2 years ago
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()))
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)Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
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.