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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mazwro
Helper II
Helper II

Avg Time Card works fine but not on a graph

I have a metric which is a Time formatted AvgFixTime for an incident:

mazwro_0-1734495911596.png

I created a card and it works fine when I put it in a Card visual:

AvgFixTime_Format = format(AVERAGE(Source[FixTime]),"hh:mm"). I tested it on a handful of records and this is the right average.

 

.

mazwro_1-1734496027228.png

 

The problem happens when I want to put this on a graph and add categories, so that I get an average fix time for a Priority level:

I needed to remove the FORMAT(x) because the visual was not showing with this, and I get values of 0.12 or 0.13 etc:

mazwro_2-1734496201561.png

How can I fix this so that the properly formatted time shows on a graph?


 
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @mazwro 

 

Time can be used as category but not as axis values pertaining to the height or length of the lines or bars. Even if the data is custom formatted, it will not return the time format but the format itself.

danextian_0-1734502213590.png

 

What you can do instead is use a custom label to show a properly formatted time.

 

danextian_1-1734502296019.png

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
v-prasare
Community Support
Community Support

Hi @mazwro, Hope your doing well.

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by our community members helps you? or let us know if you need any further assistance here? 

 

Your feedback is important to us, Looking forward to your response.

 

Thanks,

Prashanth Are

MS Fabric community support.

 

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

v-prasare
Community Support
Community Support

Hi @mazwro,

Thanks for actively participating in MS Fabric community Support.

 

As we haven’t heard back from you, we wanted to check in to see if the resolution provided by the community members worked for you.

If you’re still facing any issues or have additional questions, please don’t hesitate to let us know. We’re here to help and would be happy to assist further if needed. Looking forward to your feedback!

 

 

Thanks,

Prashanth Are

MS Fabric community support.

 

Did we answer your question? Mark post as a solution, this will help others!

If our response(s) assisted you in any way, don't forget to drop me a "Kudos

v-prasare
Community Support
Community Support

Hi @mazwro,
Thanks for actively participating in MS Fabric community Support.

As we haven’t heard back from you, we wanted to check in to see if the resolution provided by the community members worked for you.

If you’re still facing any issues or have additional questions, please don’t hesitate to let us know. We’re here to help and would be happy to assist further if needed. Looking forward to your feedback!

 

 

Thanks,

Prashanth Are

MS Fabric community support.

 

Did we answer your question? Mark post as a solution, this will help others!

If our response(s) assisted you in any way, don't forget to drop me a "Kudos

danextian
Super User
Super User

Hi @mazwro 

 

Time can be used as category but not as axis values pertaining to the height or length of the lines or bars. Even if the data is custom formatted, it will not return the time format but the format itself.

danextian_0-1734502213590.png

 

What you can do instead is use a custom label to show a properly formatted time.

 

danextian_1-1734502296019.png

 

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
dharmendars007
Super User
Super User

Hello @mazwro , 

 

Use the AVERAGE function directly without FORMAT(), this will return a numeric value which can be used in charts.

 

AvgTime = AVERAGE(YourTable[TimeColumn])


Create a secondary measure to display the time as text only for cards

AvgTime_Formatted =
VAR TotalMinutes = [AvgTime] * 1440
VAR Hours = INT(TotalMinutes / 60)
VAR Minutes = MOD(TotalMinutes, 60)
RETURN
IF(Hours > 0,
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00"),
"00:" & FORMAT(Minutes, "00"))

 

Use the AvgTime measure (without FORMAT()) in the graph visual, as numeric values are needed for plotting.

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

grazitti_sapna
Super User
Super User

Hi @mazwro ,

Key Issue is is Power BI visuals like graphs cannot use text-formatted time (hh:mm) because FORMAT converts values to text, which cannot be aggregated or plotted. Instead, you need to work with the underlying decimal time value (fractions of a day) and display it in a readable time format. Use a Tooltip or Data Labels for Formatted Time

I hope the provided solution works for you

If I have resolved your question, please consider marking my post as a solution. Thank you!
A kudos is always appreciated—it helps acknowledge the effort and keeps the community thriving.

 

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.