cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
suoko
Level: Powered On

How to check table rows with consecutive dates

I have a very simple table like this:

 

DateSlot 1Slot 2
1-1-2020johnsam
1-2-2020 john
1-5-2020 sam
1-7-2020sam 
1-8-2020sam 

 

I want to know that both john and sam are on that table with two consecutive dates (1 and 2 of jan for john while 7 and 8 of jan for sam).

To catch the presence of two rows with two consecutive dates I was thinking something like:

CountRows(Filter(table, Date >= DateAdd(Date, -1) && Date >= DateAdd(Date, +1))

but it's not working.

 

I'm sure I'm not the first person with this issue, a cross post would be enough, I might just have just used the wrong words during my research.

1 REPLY 1
Super User
Super User

Re: How to check table rows with consecutive dates

@suoko 

Please give this code a try:

AddColumns(
    RenameColumns(your_datasource_name, "ID", "currentID","Date", "currentDate"),
    "isNextRowSameDate",
    !IsBlank(LookUp(
                your_datasource_name,
                ID =  currentID + 1 And Date = currentDate
            )
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,496)