Forum Discussion

MattTrollope's avatar
MattTrollope
Frequent Visitor
1 year ago
Solved

Converting BST DateTime to UTC Date from Dataverse data import

Hi I have a DateTime field that during BST is imported and stored as 23:00 on the previous day. When I remove the time from it (to enable searching specific days), it is then stored as one day earli...
  • mark_endicott's avatar
    1 year ago

    MattTrollope - I assume you're doing this in Power Query, in which case the logic below creates a TRUE/FALSE column in a table to define BST dates. Hopefully you can use this to implement appropriate logic to subtract an hour off the time where necessary:

     

     

    isBST = Table.AddColumn(#"Changed Type", "isBST", each 
        ([date_value] >= Date.StartOfWeek(#date(Date.Year([date_value]),3,28), Day.Sunday))
        and 
        ([date_value] < Date.StartOfWeek(#date(Date.Year([date_value]),10,28), Day.Sunday))),

     

     

    [date_value] is the name of the date column in your table. 

     

    Starting point would be to wrap this entire statement (after each) in an IF and then implement the necessary logic to minus one hour.

     

    If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!