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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
beeisabelm
Employee
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
Super User
Super User

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

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

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
Super User
Super User

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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors