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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Applicable88
Impactful Individual
Impactful Individual

PowerBi server weekday vs. local weekday

Hello,

 

I need a function to return the day number of the real local time. My offset to the server are two hours. I use this for my calculated column which shows me the number of today. I created it and load data to double check if I get it right. value: Date.DayOfWeek(DateTime.FixedLocalNow(), Day.Sunday)

It works as long the lagging UTC Time from the server is on the same day, but not in the midnight time. 

I use it in  a nested  if-statement for a Friday condition: if Date.DayOfWeek([Orderdate]) = 5 then........else..

Since its not a date and just a number, how to get it returns 5 even after thursday midnight to Friday, when server time is still two hours lagging and at day 4?

A combination with DateTimeZone.SwitchZone didn't return 5 as well, but only error.

Thank you in advance.

Best. 

 

 

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @Applicable88 

 

Not sure if I understand it correctly, so you want to know the weekday of server time and it is fixed 2 hours lagging, like this?

 

Date.DayOfWeek((DateTime.FixedLocalNow()- #duration(0,2,0,0)), Day.Sunday)

 

View solution in original post

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Applicable88 

 

Have you tried @Vera_33 's solution? It should work. You can use it in your if-statement then. Kindly accept it as the solution if it helps solve this problem. If not, share more details about your expected result.

 

Regards,
Community Support Team _ Jing

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Applicable88 

 

Not sure if I understand it correctly, so you want to know the weekday of server time and it is fixed 2 hours lagging, like this?

 

Date.DayOfWeek((DateTime.FixedLocalNow()- #duration(0,2,0,0)), Day.Sunday)

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors