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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
aarola
Frequent Visitor

"cannot convert text to date type" dddd, hh:mm:ss

I am using formula format (date, "dddd, hh:mm:ss"). Seems like this custom format is not accepted as date type, so I can only get it as a text. If I try to set it as a date type, I am getting error "cannot convert text to date type".

 

Is it possible to add additional date formats? 

 

Since Power BI only takes it as text, this is the resulting x-axis graph...image.png

 

 

 

 

Power BI tries to show all of the points (15 min over 1 week), which is not possible to fit in any graph. As far as I know, that would be solved if it was a date type axis.

 

Any ideas? Thanks!

 

 

 

4 REPLIES 4
aarola
Frequent Visitor

Still didn't get any valid solution. Found another example, someone trying to do something quite similar:

https://www.reddit.com/r/PowerBI/comments/7f60kg/how_to_get_cumulative_line_chart_with_monthday_on/

 

 

Tried applying hierarchy, didn't work, axis does not autoscale:

 

image.png

 

Tried with a "time index", so that axis is a whole number, defining a continuous value for each axis point, but then you don't have a clue of axis position (day? time?):

 

image.png

 

Tried increasing page size, but visuals do not scale properly.

 

Would it be possible to create a custom line chart visual which allows to do something like this? Any other options?

 

Thank you everyone involved.

Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @aarola

 

You are better off using an actual date field for the axis.  That will stop you needing to scroll left and right.

 

If you use the FORMAT function, you are converting your date to a TEXT value, which won't auto scale on the axis.

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark,

 

Thank you for your answer. I am trying to compare my data between weeks. That's what I am trying to do:

 

image.png

 

That's why I cannot have a "real" date, I just want to compare mondays all together.

@aarola,

It is not possible to convert your field from text to date type as the values in the field are not valid dates.

Consider to use real date field as other post, or reduce the rows in your table.

Regards,

Lydia

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

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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