Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Transform text (YYYYMMDD) to Date when some cells are empty

Hi,   In the Power Query Editior I have a column, lets call it "column" with a date in Text-format When Date is filled it will show: YYYYMMDD When Date is not filled it will show: 0   I would...
  • Fowmy's avatar
    6 years ago

    Anonymous 

    Add an if condition to check. 

    =if [Column] = "0" 
    then 0 
    else
    Date.FromText(
    Text.Range([Column], 0, 4) &
    "-" &
    Text.Range([Column], 4, 2) &
    "-" &
    Text.Range([Column], 6, 2) )

     

    ________________________

    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