# Power BI: Convert text (yyyymmdd) to date (mm/dd/yyyy)



## MAS6828 (Mar 25, 2018)

I am importing a text file where the date columns are coming through as whole numbers (yyyymmdd). When I try to transform to date, I get error. I tried to add a custom column with DAX formula Date(mid([Column1], 1,4), mid([Column1​], 5, 2), mid([Column1​], 7, 2)). Then I get error "The Name DATE is not recognized".

What can I do to correct this?

Thanks


----------



## tlowry (Mar 25, 2018)

Welcome to MrExcel!

Here's a hint:


```
=DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2))
```

This will convert one of your dates (in A2) to an "Excel" date.  

Next, look at formatting dates.


----------

