Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
LilMurph
Frequent Visitor

Generate a specific time when using Date function

Hi Everyone

 

I have created a column that provides the date of Thursday in Date/time format based on on the week number (given by another column [Week]) using the following formula:

Thursday = IF('Data'[Week]=1,date(2021,12,30), date(2022,1,((('Data'[Week])-1)*7)-1))
 
So if the [Week] column is 1 the date provided is 30/12/2021 00:00:00, if the [Week] column is 2 the date provided is 06/01/2022 00:00:00 and so on.
 
The problem is that I need the time to be 17:00:00 as this is the exact moment in the week that I need to refference as the cutoff point for staff submitting late timesheets. I have had a good goolge and tried a few things myself but I can't figure out how to specify a time. I tried concatinating a Date and a Time finction but that generates the Data type as Text and I need it to be in Date/time format. 
 
Any help would be greatly appriciated.
 
Cheers
LilMurph
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@LilMurph , Assume this is correct

Thursday = IF('Data'[Week]=1,date(2021,12,30), date(2022,1,((('Data'[Week])-1)*7)-1))

 

You can get with time like

Thursday = IF('Data'[Week]=1,date(2021,12,30), date(2022,1,((('Data'[Week])-1)*7)-1)) + time(17,0,0)

 

 

refer if needed for week start date

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@LilMurph , Assume this is correct

Thursday = IF('Data'[Week]=1,date(2021,12,30), date(2022,1,((('Data'[Week])-1)*7)-1))

 

You can get with time like

Thursday = IF('Data'[Week]=1,date(2021,12,30), date(2022,1,((('Data'[Week])-1)*7)-1)) + time(17,0,0)

 

 

refer if needed for week start date

Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.