cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

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).

 

Error.PNG

 

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Query Editor & POwer BI Date Transformation

Hi @irnm8dn,

 

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:
1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Highlighted
Community Champion
Community Champion

Re: Query Editor & POwer BI Date Transformation

@irnm8dn

 

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.

 

 

 




Lima - Peru
Highlighted
Post Prodigy
Post Prodigy

Re: Query Editor & POwer BI Date Transformation

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.

Highlighted
Community Champion
Community Champion

Re: Query Editor & POwer BI Date Transformation

@irnm8dn

 

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

 

What is the result that you want to obtain. 

 

 




Lima - Peru
Highlighted
Post Prodigy
Post Prodigy

Re: Query Editor & POwer BI Date Transformation

I simply wanted to show the range in the visulaization, and have the correct format.

 

When following your instructions, it does format it as a date.

Highlighted
Community Champion
Community Champion

Re: Query Editor & POwer BI Date Transformation

@irnm8dn

 

Your column look like this:

 

12/6/15 - 12/12/15

 

What is the format expected in the transform?

 




Lima - Peru
Highlighted
Post Prodigy
Post Prodigy

Re: Query Editor & Power BI Date Transformation

Same as what it looks like in the column, formatted as a date.

Highlighted
Community Champion
Community Champion

Re: Query Editor & Power BI Date Transformation

@irnm8dn

 

Ok, to my knowledge that's not possible. Smiley Sad

 

 

 




Lima - Peru
Highlighted
Microsoft
Microsoft

Re: Query Editor & POwer BI Date Transformation

Hi @irnm8dn,

 

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:
1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors