The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
since the server runs in UTC i have 2 hours difference. The problem is that I have a calculation running for specific days. I used the a formula to offset the hours: Time.Hour(DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),2,0))
But I also have a date problem, for example now in my local time its actually 1 o'clock in the morning and its Friday. The server displays 11PM but is still on Thursday. So in my very long m formula I also have a condition for when weeknumber = 5 and so fourth.
So since the report still thinks its Thursday these values won't be displayed.
I tried this:
Time.Hour(DateTimeZone.SwitchZone(Date.From(DateTime.LocalNow()),2,0))
But I got error. I want a date to return, not time.
I also need to correct when its really Friday around the midnight range:
Date.DayOfWeek(DateTime.FixedLocalNow(), Day.Sunday)
Anyone has an idea? Thank you very much in advance.
Best.
Solved! Go to Solution.
You should be able to use this as your core expression and then wrap it in whatever you need to get your desired results.
= DateTime.LocalNow() + #duration(0,2,0,0)
For example, if you wrap it in Date.From, you will get tomorrows date (if it is >10 PM).
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You should be able to use this as your core expression and then wrap it in whatever you need to get your desired results.
= DateTime.LocalNow() + #duration(0,2,0,0)
For example, if you wrap it in Date.From, you will get tomorrows date (if it is >10 PM).
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.