Forum Discussion

henrycqc's avatar
henrycqc
Icon for Helper II rankHelper II
4 years ago
Solved

Include only Latest 3 months of data

In power query, I want to limit the amount of data loaded into the model by only including new data within the last 3 months from a dataflow.  So far found this YouTube video “ https://youtu.be/zr52Q...
  • BA_Pete's avatar
    BA_Pete
    4 years ago

    henrycqc 

     

    Based on your initial example code:

    let
      Source = Dates,
      #"Filtered Rows" = Table.SelectRows(Source, each [dates] >= Date.AddMonths(Date.From(DateTime.LocalNow()), -3))
    in
      #"Filtered Rows"

     

    Substitute [dates] here with whatever the date field in your fact table is called.

     

    Pete