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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
miltenburger
Helper V
Helper V

Automatically delete data from import

Hi all,

 

Currently i'm finishing my intership assignment. But i face 1 issue during refreshing my data.

Currently I import all my data into Power Bi (I also tried DirectQuery but it is way to slow).

I import all my data from a SQL Database, where I have a query which says: take all the data from now till 12 months ago. Works perfect.

 

But when I refresh my data next week, the SQL statement still works fine, but the data from 12 months ago + 1 week is still in my imported data list. Is there a way to automatically delete the data from 12 months / + 1 week (So for instance the data from 30-10-2016 till 5-11-2016)

 

Kind regards

1 ACCEPTED SOLUTION

Hi @Abduvali,

 

Instead of using SQL statement, you should also be able to simply use Date.IsInPreviousMonth function(M) in Advanced Editor to import data from now till 12 months ago. Smiley Happy

    #"Filtered Rows" = Table.SelectRows(dbo_DimDate, each Date.IsInPreviousNMonths([FullDateAlternateKey], 12))
in
    #"Filtered Rows"

filter.PNG

 

Regards

View solution in original post

10 REPLIES 10

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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