Forum Discussion

1Kash's avatar
1Kash
New Member
2 years ago
Solved

Query Last 100 Days for Past 3 Years

Greetings All,   I'm looking to set up a daily query that will pull the last 100 days from TODAY, for the current-year, prior-year and prior-prior-year periods.   The date ranges would look somet...
  • ThxAlot's avatar
    2 years ago

    Construct the periods by yourself (take 5 days for example)

    let
        Source = let today=Date.From(DateTime.LocalNow()) in List.Accumulate({0..2}, {}, (s,c) => s & List.Dates(Date.AddYears(today, -c), 5, #duration(-1,0,0,0)))
    in
        Source