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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
domcv
Helper I
Helper I

date displayed with minus hours power bi

have a date column in the table. But i saw that minus values with dates.

domcv_0-1655020997767.png

ex: -0400 

 

What does this mean? need to convert it to date format so when i convert it to date format it gives column like this.

 

 

domcv_1-1655021144547.png

actual date is 2022/06/08 but after converting to date format it gives 2022/06/09. I guess this is due to minus hours. Any method to fix this issue? 

1 ACCEPTED SOLUTION
hansei
Helper V
Helper V

There is no subtraction going on there. The timestamp includes a timezone. If you do not care about the timezone, you can remove it. Unsure what your transformation looks like, but you will want to change it from code akin to Custom1 in the example to Custom2

let
    Source = Table.FromRows({{"2022-06-08T02:39:57.088-0400"}}),
    #"Added Custom1" = Table.AddColumn(Source, "Custom", each Date.From(DateTimeZone.FromText([Column1]))),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom2", each Date.From(DateTimeZone.RemoveZone(DateTimeZone.FromText([Column1]))))

in
    #"Added Custom2"

 

View solution in original post

1 REPLY 1
hansei
Helper V
Helper V

There is no subtraction going on there. The timestamp includes a timezone. If you do not care about the timezone, you can remove it. Unsure what your transformation looks like, but you will want to change it from code akin to Custom1 in the example to Custom2

let
    Source = Table.FromRows({{"2022-06-08T02:39:57.088-0400"}}),
    #"Added Custom1" = Table.AddColumn(Source, "Custom", each Date.From(DateTimeZone.FromText([Column1]))),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom2", each Date.From(DateTimeZone.RemoveZone(DateTimeZone.FromText([Column1]))))

in
    #"Added Custom2"

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.