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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
WinterGarden
Helper III
Helper III

Not showing the correct date values in service even after creating the time zone custom column

Hi All,

I am facing an issue in which the date values from the sharepoint list is showing as one day before the actual date in powerbi service.
In order to solve that issue i've created a custom column , similar to the steps mentioned in this article:
https://cloudbi.com.au/converting-utc-to-local-datetime-in-power-bi/


these are the steps i've performed:

1) created a custom column using below code:
DateTimeZone.RemoveZone(DateTimeZone.SwitchZone([Project Start Date],5.30))
2) converted the type of the column to date

even after creating the custom column it is showing incorrect dates.. one day before in most cases..

faced similar issue earlier in another project. In that file as well i've created the same custom column.. and it was showing the correct date in service after schdule refresh.. only difference is that the date format of that column is general

WinterGarden_0-1732082578792.png

 and in the one i am facing this issue it is long date

WinterGarden_1-1732082636314.png


does anyone know what is the issue?



1 ACCEPTED SOLUTION
Jai-Rathinavel
Solution Sage
Solution Sage

Hi @WinterGarden , You must first identify the TimeZone which is followed for populating Project Start Date. Based on the time difference you can tweak the m code of your custom column

If you notice about 7 hours and 30  mins difference consider below code

[Project Start Date] + #duration(0, 7, 30, 0)

If you find 1 day difference use the below one

[Project Start Date] + #duration(1, 0, 0, 0)

If you couldn't back track the timezone, consider manually tweaking the numbers inside #duration untill you get the correct date.

 

Did I answer your question ? Please mark my post as a solution 

 

Thanks,

Jai

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @WinterGarden ,

 

Thanks to Jai-Rathinavel  and shafiz_p  for their quick replies. Did their replies help you resolve your issue? If so, please accept the helpful replies as solutions to help users with the same problem, and if not, please point them out.

 

Best Regards,

Neeko Tang

Jai-Rathinavel
Solution Sage
Solution Sage

Hi @WinterGarden , You must first identify the TimeZone which is followed for populating Project Start Date. Based on the time difference you can tweak the m code of your custom column

If you notice about 7 hours and 30  mins difference consider below code

[Project Start Date] + #duration(0, 7, 30, 0)

If you find 1 day difference use the below one

[Project Start Date] + #duration(1, 0, 0, 0)

If you couldn't back track the timezone, consider manually tweaking the numbers inside #duration untill you get the correct date.

 

Did I answer your question ? Please mark my post as a solution 

 

Thanks,

Jai

Hi @Jai-Rathinavel ,
This resolved the issue.. Thank you!

shafiz_p
Resident Rockstar
Resident Rockstar

Hi @WinterGarden  Instead of using DateTimeZone.RemoveZone, try using DateTimeZone.ToLocal to convert the time to your local time zone. For example:

DateTimeZone.ToLocal(DateTimeZone.SwitchZone([Project Start Date], 5.5))

Try converting the date to a standard format before applying the time zone conversion.

 

Verify the locale settings in Power BI Service. You can set the locale for your dataset in the Power BI Service settings to ensure it matches your local time zone.

 

shafiz_p_0-1732084811841.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.