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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jimmyg706
Helper IV
Helper IV

Newbie: Advice on Formatting a Date Column (from a data source)

Evening Folks

 

Im having some trouble with a date column. It comes into to PBI in the following format:   2023-08-24T15:41:13Z

 

Now I want a dd/mm/yy format with no time so above would be 24/08/2023

 

Unfortunately I cant just change it to Date (Transform)  as it says error for all the records if I transform and change the type to dd/mm/yy

 

So I normally select the column and Add Column With Examples

 

In PBI you are then prompted to put in an example but it always has the time extension after see below

 

jimmyg706_0-1694719985539.png

 

If I just go with the flow I to get a new date column that looks like dd/mm/yy however when I tried to some DAX calculations on it – I get this error message:

 

Cannot convert value '2023-08-24T00:00:00Z' of type Text to type Date.

 

jimmyg706_4-1694720052693.png

 

In my Table   2023-08-24T00:00:00Z' looks like 24/08/2023 and is formatted as Date but it clearly isn’t.

 

Question:  What method would use to get to my end game which is a date only column?

 

 

Fig 1 – Original Column – If I try and change to date (transform) I get errors

 

jimmyg706_1-1694720004071.png

 

Fig 2

 

After Creating Column with examples I have the following and notice it doesn’t look like a Date column

 

jimmyg706_2-1694720017972.png

 

Data View  - Table View – It all looks like expected.

 

jimmyg706_3-1694720034549.png

 

DAX Calculated Column and notice the error:  Cannot convert value '2023-10-09T00:00:00Z' of type Text to type Date.

 

jimmyg706_4-1694720052693.png

 

 

If anyone can suggest a better way  it would be appreciated.

 

Jimmy

 

 

1 ACCEPTED SOLUTION
ChiragGarg2512
Super User
Super User

@jimmyg706 , Click on the Task Completed At column, then go to Transform->Date->Parse.
Remember to select the column.

 

ChiragGarg2512_1-1694763321671.png

 

 

ChiragGarg2512_0-1694763295932.png

 

ChiragGarg2512_2-1694763365363.png

 

 

 

View solution in original post

4 REPLIES 4
jimmyg706
Helper IV
Helper IV

@ChiragGarg2512   Indeed the parse worked in that I can now get my formulsd to work with DATEDIF which was the main challenge.

 

It still doesnt see it as a Date field but I will persevere on this one. 

 

So a big thanks for solving.

 

Jimmy

ChiragGarg2512
Super User
Super User

@jimmyg706 , Click on the Task Completed At column, then go to Transform->Date->Parse.
Remember to select the column.

 

ChiragGarg2512_1-1694763321671.png

 

 

ChiragGarg2512_0-1694763295932.png

 

ChiragGarg2512_2-1694763365363.png

 

 

 

ChiragGarg2512
Super User
Super User

In Power Query, on right clicking the column header there is an option to change the format from date/time to just date.

ChiragGarg2512_0-1694721008151.png

 

Try this and if the problem continues, send some data in tabular format.

Thanks @ChiragGarg2512 

 

Indeed I tried that.

 

Ive pasted some data below

 

Task Completed At
2023-08-21T06:23:35Z
2023-08-21T06:23:36Z
2023-08-21T06:24:40Z
2023-08-21T06:24:40Z
2023-08-21T06:24:41Z
2023-08-22T09:12:31Z
2023-09-01T18:32:25Z
2023-09-08T09:56:38Z
2023-09-08T09:56:38Z
2023-09-08T09:56:38Z
2023-09-08T09:56:39Z
2023-09-08T09:56:39Z
2023-09-14T10:41:23Z

 

 

jimmyg706_0-1694728121180.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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