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
Anonymous
Not applicable

Custom text labels for numeric field in line chart

Is it possible to assign a text column as the label for a numeric column in a line chart?  This is only necessary because powerbi cannot build visuals from useful datetime or duration values.

 

In the example below, the line chart is built with dtRunMonth (datetime) on the x-axis and decAvgDurationSeconds (integer) as the values.  Both values already exist in my table.

 

I would like the label '1108' to be replaced by '0:00:18:28' (text field).  How can I accomplish this?

jrbrown00_0-1644004939545.png

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous Use Chelsie Eiden's duration to display durations as hh:mm:ss for example but leave underlying number numeric. Also, you can use a similar technique to use dates and datetimes in Y-Axis for example:

(1) Chelsie Eiden's Duration - Microsoft Power BI Community

Dates and DateTime in Y - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Anonymous Use Chelsie Eiden's duration to display durations as hh:mm:ss for example but leave underlying number numeric. Also, you can use a similar technique to use dates and datetimes in Y-Axis for example:

(1) Chelsie Eiden's Duration - Microsoft Power BI Community

Dates and DateTime in Y - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Sign me up as a Chelsie Eiden fan!

I put it into a single line in the data view to work directly from a SQLServer DateTime field:

DurationNeedsCustomFormat = Hour(MyTable[DateTimeField]) *10000+Minute(MyTable[DateTimeField])*100 +Second(MyTable[DateTimeField])

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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