cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
daniels471
Helper II
Helper II

date lookup issue

hi , I'm having trouble again with a different formula now 

LookUp('week list','startdate (calc)'=DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday),Days),week)

 

I want to have it so it gets the week number ( which is listed in the column "week" in the SP list " Week List" 

the "start date (calc)" column does include the time as i read this can cause issues 

 

there are no errors ,it just simply provides no output

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@daniels471 

If the column you are comparing has a time, then you will need to provide the exact match to the time as well.

You current formula is focused on the date without time.

If you want to compare equal types on both side of the equals, then consider this formula:

 

LookUp(
    'week list',
    Text('startdate (calc)', ShortDate) = Text(DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday),Days), ShortDate),
    week
)

This will convert both sides to a shortdate text format and then they will compare properly.

Note: this is not a delegable operation and will produce a warning as such.  If record limits are not a concern, you can ignore it.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
rebeccas
Community Champion
Community Champion

Is your column 'startdate (calc)' an actually calculated column or a date/time column?

RandyHayes
Super User
Super User

@daniels471 

If the column you are comparing has a time, then you will need to provide the exact match to the time as well.

You current formula is focused on the date without time.

If you want to compare equal types on both side of the equals, then consider this formula:

 

LookUp(
    'week list',
    Text('startdate (calc)', ShortDate) = Text(DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Monday),Days), ShortDate),
    week
)

This will convert both sides to a shortdate text format and then they will compare properly.

Note: this is not a delegable operation and will produce a warning as such.  If record limits are not a concern, you can ignore it.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

that worked , along with the fact that i actually had the wrong start date in my share point list so of course it never was going to match

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,386)