Forum Discussion
Judy101
1 year agoFrequent Visitor
Subset of dates from a table using Power query
Looking for Power query that helps list dates in a table from a pre-exisiting table. Conditions: 1. Minimum date should be 1st date of data from 26 months back. Example if today is 3/25/2025, I wan...
- 1 year ago
Hello Judy,
You can try below M script
let
Today = Date.From(DateTime.LocalNow()),
StartDate = Date.StartOfMonth(Date.AddMonths(Today, -26)),
DateList = List.Dates(StartDate, Duration.Days(Today - StartDate) + 1, #duration(1,0,0,0)),
DateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}, null, ExtraValues.Error)
in
DateTable
Thanks,
PankajIf this solution helps, please accept it and give a kudos, it would be greatly appreciated.
v-ssriganesh
Community Support
1 year agoHi Judy101,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.