Hello. I have a start date and an end date from a date picker. I want to generate a collection with dates between those dates. Is this possible?

Hello. I have a start date and an end date from a date picker. I want to generate a collection with dates between those dates. Is this possible?
Hi @314mp_M0th4
Here is how you can put all dates within a range into a collection:
Have a screen with two date pickers, button and gallery (to show the date range collection)
Set the Button.OnSelect to this:
ClearCollect(
DateRange,
AddColumns(
FirstN(
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],
DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate, TimeUnit.Days) + 1),
"Day",
"Day " & (Value + 1),
"Date",
DateAdd(DatePicker1.SelectedDate, Value, TimeUnit.Days)
)
)This function will create a collection with three columns Value (from 0 to 29, it is used to produce Day and Date column), Day (basically just Day X - where X is the number of the day in the collection), Date (the actual date). It will include all dates between DatePicker1 and DatePicker2.
Limitations: This function can maximum have range of 30 days (Because of the FirstN() function), if you want to allow bigger ranges add more numbers after 29. It only works if DatePicker1 has date which is equal or smaller than DatePicker2.
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻