Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Salesforce Data Import to PowerBI - Time Stamp Issue

Hello,   I'm importing data from our Salesforce enviroment into PowerBI using Salesforce Objects data connector in PowerBI. For some unknown reason, the Time Stamp for Appointment Start Time is cha...
  • edhans's avatar
    5 years ago

    Simply change it from the Date/Time/Timezone format to Date/Time. It will adjust the time based on the TZ offset.

     

    becomes

    Note that you might need two steps to do this. If you went from text to date/time/timezone, you cannot change that to date/time, you need an additional step that change d/t/tz to d/t.


    See this code for a full example:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtY3NNA3MjAyVDC1MjS1MjBQCPBV0DUAsZRidUDylhBpEytjAzTpWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type datetimezone}}),
        #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Column1", type datetime}})
    in
        #"Changed Type1"

    How to use M code provided in a blank query:
    1) In Power Query, select New Source, then Blank Query
    2) On the Home ribbon, select "Advanced Editor" button
    3) Remove everything you see, then paste the M code I've given you in that box.
    4) Press Done
    5) See this article if you need help using this M code in your model.

     

    If you need more help, please post data using this info. We cannot use images for source data.

     

    How to get good help fast. Help us help you.

    How To Ask A Technical Question If you Really Want An Answer

    How to Get Your Question Answered Quickly - Give us a good and concise explanation
    How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.