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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
beeisabelm
Microsoft Employee
Microsoft Employee

DAX to permanently remove rows past data retention policy of 60 days

How can I create a DAX to remove the rows from the table to comply with the data retentino policy of 60 days? I have been refreshing a CSV file with weekly new data and would like to run a function to remove all data order than 60 days. I found some references to create new table with rows removed, but that's not applicable.

4 REPLIES 4
ImkeF
Community Champion
Community Champion

Hi

you can set a "relative date filter" in the query editor like so:

 

image.png

 

then apply the filter like so:

image.png

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

beeisabelm
Microsoft Employee
Microsoft Employee

@ImkeF I need to PERMANENTLY DELETE old data, not just filtering them out from the view. Thanks!

ImkeF
Community Champion
Community Champion

Just to make sure my understanding is correct: You want to delete rows in the underlying csv files that you're importing with Power BI?

That's not possible with native Power BI. You'd have to use Python- or R-scripts (from Power Query) for that.

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Greg_Deckler
Community Champion
Community Champion

You can't really do that in DAX, you would want to use power query. @ImkeF should be able to help you.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.