Forum Discussion
SebaSpotti
Advocate II
1 year agoUnpivot a table with dates beetwen
Hi all! I have a table like this : Start_Date End_Date Type_of_Car Number 20/10/2024 25/10/2024 Car A 2 08/02/2024 12/02/2024 Car B 3 and I want to obtain (with power qu...
- 1 year ago
Hi SebaSpotti
You can refer this post:
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2it should resolved your issue, and if it does please give this a thumbs up and accept the solution
Many Thanks
Dark
danextian
Super User
1 year agohi SebaSpotti
You don't really unpivot but expand the start and end dates into rows of dates within the range. The custom column below will generate a list of dates whicn can be expanded into rows.
let
//generate a series of numbers from the start and end dates as a list
series = {Number.From([Start_Date])..Number.From([End_Date])},
//convert the numbers back to dates
todates = List.Transform(series, Date.From)
in
todates