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

Avoid duplicate dates in gallery display

Hey Guys,

 

i want to only make unique and first dates visible in my gallery.

 

At the momen the gallery looks like this

 

01.06.2022      Data

01.06.2022      Data

02.06.2022      Data

02.06.2022      Data

 

And I want to make it look like this

 

01.06.2022      Data

                       Data

02.06.2022      Data

                       Data

 

This is how far i have come (under visible i have the following code):

 

If(
Index(
Filter(Time;Text(Starttime;"dd/mm/yyyy")=Text(ThisItem.Starttime;"dd/mm/yyyy"));1).ID =ThisItem.ID;true;false)

 

This code only displays the unique dates, but i also want the first of the not unique dates.

Can somebody help me?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-liwei-msft
Community Support
Community Support

Hi @Drep,

 

Could you please tell me if your DataSource is SharePoint? 

 

1. You can use the CountRows function to nest filter functions: The fliter function is used to filter out the records whose date column of the data source is equal to the ThisItem. date column. The CountRows function is used to count the number of filtered records. 

2. If the result of CountRows is equal to 1, it means that the date of the record is unique, set its visible property to true. 

3. If the CountRows result is greater than 1, it proves that there are multiple records with the same date. Use the LookUp function to get the record with the smallest ID among the records with the same date, and make its Visible property true(ID is a column that comes with SharePoint).

 

I have made a test for your reference:

1.

vliweimsft_0-1656669630612.png

 

2.

vliweimsft_1-1656669630614.png

 

3.

vliweimsft_2-1656669630615.png

 

Best Regards,

Levi

 

View solution in original post

2 REPLIES 2
v-liwei-msft
Community Support
Community Support

Hi @Drep,

 

Could you please tell me if your DataSource is SharePoint? 

 

1. You can use the CountRows function to nest filter functions: The fliter function is used to filter out the records whose date column of the data source is equal to the ThisItem. date column. The CountRows function is used to count the number of filtered records. 

2. If the result of CountRows is equal to 1, it means that the date of the record is unique, set its visible property to true. 

3. If the CountRows result is greater than 1, it proves that there are multiple records with the same date. Use the LookUp function to get the record with the smallest ID among the records with the same date, and make its Visible property true(ID is a column that comes with SharePoint).

 

I have made a test for your reference:

1.

vliweimsft_0-1656669630612.png

 

2.

vliweimsft_1-1656669630614.png

 

3.

vliweimsft_2-1656669630615.png

 

Best Regards,

Levi

 

Drep
Frequent Visitor

Hi @v-liwei-msft ,

 

thank you very much for your answer & solution. 

Yes i am working with an Sharepoint list.

 

My solution now looks like this: 

If(
If(
CountRows(
Filter(
Zeiterfassung;
Startdatum = ThisItem.Startdatum; Person.Id = ThisItem.Person.Id
)
) > 1;
LookUp(
Zeiterfassung;
Startdatum = ThisItem.Startdatum And Person.Id = ThisItem.Person.Id
).ID
) = ThisItem.ID;
true;
CountRows(
Filter(
Zeiterfassung;
Startdatum = ThisItem.Startdatum; Person.Id = ThisItem.Person.Id
)
) = 1;
true
)

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,273)