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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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.


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

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors