Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Query Editor & POwer BI Date Transformation

I have 3 date columns, Order Start Date, Order End Date and Week (which is how the performance data is aggregated).  Within the Query Editor, I can change Order Start Date, and Order End Date to a data type of Date.  Then within Power BI, I change the format.  No problems with these columns.

 

The "Week" column is being a little more stubborn.  When I change the Data Type the column populates with Error (see below).

 

 

If I try to convert this in PowerBI, I receive an Error that says it can't convert the data type!

 

I have included a link to a sample dataset, in hopes someone can help me problem solve this.

 

https://www.dropbox.com/s/gbzdwo6qxxt026x/sample%20data.xlsx?dl=0

 

Thanks.

 

 

  • Hi Anonymous,

     

    If I understand correctly, you want to set the data type of column [Week] to Date, and display date range in format '12/6/15 - 12/12/15', right? But this is not a supported date format, it will be considered as string. That is why you got the error when you attempt to convert it to date. 

     

    Below image shows all the date formats which are supported now:

     

    Best regards,
    Yuliana Gu

8 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi Anonymous,

     

    If I understand correctly, you want to set the data type of column [Week] to Date, and display date range in format '12/6/15 - 12/12/15', right? But this is not a supported date format, it will be considered as string. That is why you got the error when you attempt to convert it to date. 

     

    Below image shows all the date formats which are supported now:

     

    Best regards,
    Yuliana Gu

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    Anonymous

     

    hi, do you need Week of the year ?

     

    1, Split by delimiter Week (Use -)

    2. The First Column transform to Date-Week-Week of Year.

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the feedback Vvelarde.

       

      I do not need the week of the year, only to use it as a time dimension for performance during that period of time.

       

      If I split using the delimeter, I will lose my ability to dimensionalize the data by week range.  Not sure what you mean in your second step.

       

      Seems Power BI really struggles with "dates" and date transformaiton, no?

       

      Please advise.

      • Vvelarde's avatar
        Vvelarde
        Community Champion

        Anonymous

         

        Your Column is two dates (Start of Week and End of Week) Right?

         

        What is the result that you want to obtain.