Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello all,
I've created a table that is based on a Microsoft Exchange calendar. I'm having trouble getting a day offset based on a column on column, but only if my user scheduled column has a value. It is offsetting based on the exchange calendar date. My DAX logic is a little weird, but the problem is that it works well on the desktop. However, after I publish it, the date is pushed back an extra day or two. I'm stumped as to why this is. What are your thoughts on this?
DNE Date =
var PrevDay = 'Schedule Calendar'[Start].[Date] - 1 -- **DNE date is always one day before the start date that somone works it.**
Var NewDay1 = IF( FORMAT(PrevDay,"DDD") = "Sat", PrevDay-1,
IF( FORMAT( PrevDay,"DDD") = "Sun", PrevDay-2,
PrevDay)
) -- **for testing if PrevDay is a weekend.**
Var Holi = IF( CALCULATE( MAX('Schedule Calendar'[User Scheduled]), FILTER('Schedule Calendar', NewDay1 = 'Schedule Calendar'[Start])) = "", NewDay1 -1, NewDay1) -- **for is there what no one seduled, mostly holidays.**
Var NewDay2 = IF( FORMAT(Holi,"DDD") = "Sat", Holi-1,
IF( FORMAT( Holi,"DDD") = "Sun", Holi-2,
Holi)
) -- **for if day after Holi is weekend.**
return IF( 'Schedule Calendar'[User Scheduled] = "", BLANK(),
IF('Schedule Calendar'[Start] = DATE(2022,2,17), DATE(2022,2,16), -- **2nd if added for earliest date in start, 'Holi' logic does not work for the first date and returns with extra day. this is a one off.**
NewDay2))
@ribisht17 I'm in Central Time, not UTC Time, so they won't match. How does this matter because none of the calculations take into account time, only the date?
Are desktop and Server time zones same or not?
Solved: changing timezone of powerbi service? - Microsoft Power BI Community
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
20 | |
14 | |
12 |
User | Count |
---|---|
43 | |
31 | |
24 | |
22 | |
22 |