Forum Discussion
Date in a colums
- 5 years ago
Anonymous
Your data looks like this before extracting the dateRight-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 🙂
Yes !Half of the data in this column look likes the first three rows , the second half is like the rest.
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 🙂
- Anonymous5 years agoNot applicable
Big thanks!
Can i ask you to help me last time? You code is work ! Can you little bit change him that consider last :00
Now it loks like
P.S Sorry for bad english 🙂
- Fowmy5 years agoSuper User
Anonymous
Okay, Change number 14 to 17Text.Length([Dates]) = 17________________________
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 🙂
- Anonymous5 years agoNot applicable