Forum Discussion
miltenburger
Helper V
8 years agoAutomatically 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 slo...
- 8 years ago
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. :smileyhappy:
#"Filtered Rows" = Table.SelectRows(dbo_DimDate, each Date.IsInPreviousNMonths([FullDateAlternateKey], 12)) in #"Filtered Rows"Regards
Abduvali
Skilled Sharer
8 years agoThen just remove second line of code and just keep:
WHERE CreatedDateTime >= DATEADD(month,-12,DATEADD(day,DATEDIFF(day,0,GETDATE()),0))
This should resolve your issue!!!
Regards
Abduvali
v-ljerr-msft
Microsoft Employee
8 years agoHi 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. :smileyhappy:
#"Filtered Rows" = Table.SelectRows(dbo_DimDate, each Date.IsInPreviousNMonths([FullDateAlternateKey], 12))
in
#"Filtered Rows"
Regards
- Abduvali8 years ago
Skilled Sharer