Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
irnm8dn
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
v-yulgu-msft
Employee
Employee

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
v-yulgu-msft
Employee
Employee

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.
Vvelarde
Community Champion
Community Champion

@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

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
Community Champion
Community Champion

@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

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.

Vvelarde
Community Champion
Community Champion

@irnm8dn

 

Your column look like this:

 

12/6/15 - 12/12/15

 

What is the format expected in the transform?

 




Lima - Peru

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

Vvelarde
Community Champion
Community Champion

@irnm8dn

 

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

 

 

 




Lima - Peru

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.