Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I cannot figure out why changing a "DateTimeZone" column to type "Date" causes the date value to change.
First I convert my UTC DateTime to IST DateTimeZone
= Table.AddColumn(#"table from database", "IST Time", each DateTimeZone.SwitchZone(DateTime.AddZone([CreatedOn],0), 5.5), type datetimezone)
Then I convert to Date format
= Table.TransformColumnTypes(#"Duplicated Column",{{"IST Time", type date}})
I have outlined the dates which have been 'converted' incorrectly (Showing a copy column of Step 1 for demonstration)
I can't figure out what's going wrong. My only thought is my machines system time zone offset (+11) could be impacting it. But the threshold for when Power Bi gets it wrong doesn't seem to add up.
Thanks for the help
Solved! Go to Solution.
Ok... I tried using Date.From() but noticed in the doco it says:
..... So, it uses "local" datetime equivalent. Unsurprisingly, it gave me the same "error" as using Table.TransformColumnTypes
It didn't take long on the doco page, though, to find the answer: DateTimeZone.RemoveZone()
(then change column to "Date" format 🙂)
= Table.AddColumn(#"Changed Type", "DateTimeFrom", each DateTimeZone.RemoveZone([IST Time2]), type datetime)
Ok... I tried using Date.From() but noticed in the doco it says:
..... So, it uses "local" datetime equivalent. Unsurprisingly, it gave me the same "error" as using Table.TransformColumnTypes
It didn't take long on the doco page, though, to find the answer: DateTimeZone.RemoveZone()
(then change column to "Date" format 🙂)
= Table.AddColumn(#"Changed Type", "DateTimeFrom", each DateTimeZone.RemoveZone([IST Time2]), type datetime)
Check out the July 2025 Power BI update to learn about new features.