Forum Discussion

AOD's avatar
AOD
Helper III
4 years ago
Solved

Filter 1 year data based on current date while extraction

Hi All,  I need to extract last 1 year of data from source based on current date .  Thanks in advance for solution.   
  • amitchandak's avatar
    4 years ago

    AOD , add a filter like this in power query

    = Table.SelectRows(#"Changed Type", each [Sales Date] <= DateTime.Date(DateTime.LocalNow()) and [Sales Date] >= Date.StartOfMonth(Date.AddMonths( DateTime.Date(DateTime.LocalNow()),-12)) )