Greetings all…
I have a dates dimension with a ‘dayoffset’ column mostly to identify the current date for time intelligence calculations (e.g. dayoffset <= 0). Never had any issues with this before and have been using the same M function for a few years now. Recently, dayoffset = 0 is showing as the previous day in the Power BI service. I download the dataset, refresh the dates table which corrects this then upload the dataset again but when the dataset refreshes, it reverts back. I’ve done the corrections for UTC in power query. Even my timestamp datetime calculation is correct. I’ve uploaded a test report with four dates tables.
I see a couple of different M functions used to determine: “now”
My suggestion would be to replace that with: DateTimeZone.FixedUtcNow
So create a separate query: UTCnow = DateTimeZone.FixedUtcNow()
You can offset that to your timezone, refer to this query in all instances of your code so it’s only executed once. Other things to keep in mind.
Day light saving/summer time
Time the scheduled refresh is excecuted in the Service.
Examine your code and where the Current Date and/or Time are required enter a reference to that instead. For example below is illustrated how to get the CurrentDate from the “Now” query.
Hi @mkaess, did the response provided by @Melissa help in solving your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.
The initial issue has not been resolved. Regardless of what I do, once the dataset is refreshed in the PBI service, DayOffset is one day behind. The timestamp query that is used to calculate the DayOffset is correct in a stand alone card visual but not in the date dimension. I’m uploading a more recent version of the pbix file. Dates Dimensions.pbix (622.0 KB)
In my initial response I’ve already mentioned that you should also examine where (locale) and when (time and timezone) the scheduled refresh is taking place. Because if that is triggered before midnight the result is correct but it will be “a day behind”…