cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MuhammedNirjas
Frequent Visitor

collect all dates between two date range for every item in a gallery

MuhammedNirjas_0-1660280562099.png

i have a gallery of items with two columns visit date start and visit date end

i want to collect all dates between this two date range for all records in a collection

this is the formula i used now

ForAll(
dataSource,
Collect(
colDateRange,
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,
30,
31,
32,
33,
34,
35,
36
],
DateDiff(
'Visit Date Start',
'Visit Date End'
) + 1
),
"DateRangeDate",
DateAdd(
'Visit Date Start',
Value
)
)
)
)

but this is giving a error as "Third argument to the datediff function is invalid,do anyone have other formula to get all the dates

 

1 REPLY 1
Roverandom
Solution Supplier
Solution Supplier

See if it helps you.

 

This is my date gallery, like your example:

Roverandom_0-1660309160959.png

 

I added two date controls to filter the gallery:

Roverandom_1-1660309202948.png

Filter code:

 

Roverandom_2-1660309252588.png

 

My collection:

 

Roverandom_3-1660309292477.png

Final result:

date.gif



Hi! I hope I was helpfull. Please always mark the answer that helped you, so others who need it will find it faster.



Roverandom is a book by J.R.R Tolkien. I'm a big fan of his works and as Frodo, Aragorn or Gollum are already widely used, I decided to use this nickname.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,620)