Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Date in a colums

Hi!  Can someone help me? I have in a cloumn values like this  23.07.20 10:30 23.07.20 12:19 23.07.20 12:28 Wed Jul 29 22:33:51 MSK 2020 Wed Jul 29 22:41:44 MSK 2020 Thu Jul 30 01...
  • Fowmy's avatar
    Fowmy
    5 years ago

    Anonymous 

    Your data looks like this before extracting the date

     

    Right-click on the Column Header > Choose Transform and select TRIM
    Then Click ADD COLUMN ribbon > CUSTOM COLUMN and paste the below code.

     

    =if Text.Length([Dates]) = 14 then  
    #date(Number.From(Text.Middle([Dates],6,2)),Number.From(Text.Middle([Dates],3,2)),Number.From(Text.Middle([Dates],0,2))) 
    else 
    Date.FromText(Text.Middle([Dates],8,2) &"." & Text.Middle([Dates],4,3)&"."&Text.End([Dates],2))

    Change the Type to Date


    You can apply any formatting in Power BI Model.

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn