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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Digger
Post Patron
Post Patron

hh:mm:ss chart in pbi

How to create same excel chart in pbi?

 

Digger_0-1668698532495.png

 

1 ACCEPTED SOLUTION

@PhilipTreacy , you wrong, PBI does, i found solution

Digger_0-1668753179261.png

All you need is use this measure

_Measure HH:mm:SS =
VAR vHoursDecimal = 1111,12 // HOURS!!! not seconds
VAR vHours = INT ( vHoursDecimal )
VAR vMinutesDecimal = 60 * ( vHoursDecimal - vHours )
VAR vMinutes = INT ( vMinutesDecimal )
VAR vSeconds = ROUND ( 60 * ( vMinutesDecimal - vMinutes ), 0 )
VAR vHH = IF ( LEN ( vHours ) = 1, "0" & vHours, vHours )
VAR vMM = IF ( LEN ( vMinutes ) = 1, "0" & vMinutes, vMinutes )
VAR vSS = IF ( LEN ( vSeconds ) = 1, "0" & vSeconds, vSeconds )
RETURN
    CONVERT ( vHH & vMM & vSS, INTEGER )

 

 

and then change measure fomating, just typing 00:00:00

Digger_0-1668757963331.png

 

View solution in original post

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Digger 

 

PBI won't plot time on the Y axis like that.  The best you'll get is this

cbrt.png

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


@PhilipTreacy , you wrong, PBI does, i found solution

Digger_0-1668753179261.png

All you need is use this measure

_Measure HH:mm:SS =
VAR vHoursDecimal = 1111,12 // HOURS!!! not seconds
VAR vHours = INT ( vHoursDecimal )
VAR vMinutesDecimal = 60 * ( vHoursDecimal - vHours )
VAR vMinutes = INT ( vMinutesDecimal )
VAR vSeconds = ROUND ( 60 * ( vMinutesDecimal - vMinutes ), 0 )
VAR vHH = IF ( LEN ( vHours ) = 1, "0" & vHours, vHours )
VAR vMM = IF ( LEN ( vMinutes ) = 1, "0" & vMinutes, vMinutes )
VAR vSS = IF ( LEN ( vSeconds ) = 1, "0" & vSeconds, vSeconds )
RETURN
    CONVERT ( vHH & vMM & vSS, INTEGER )

 

 

and then change measure fomating, just typing 00:00:00

Digger_0-1668757963331.png

 

I don't think this quite works. It interprets your values as integers and that doesn't log well on the Y axis. The convert function at the end just concatenates the 3 parts into a single integer. So 59 minutes becomes 5900, 1 hour becomes 10000, and they plot as integers at those values. Your graph is then skewed.

@Digger 

 

Care to share your solution so we can see how you did it?

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Top Kudoed Authors