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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Akshay_Aso-
Frequent Visitor

Need help on Time Line chart

I need to create a Line chart of average time per month. I have a table that has month and year in one column and in another column i have hour, minute and second H:MM:SS ie, 0:01:55 format. I need to create a line chart that will give average of time per month and the time in the line chart should show in the below format,

H:MM:SS ie, 0:01:55.

when i create a line chart i am getting count of Average time and i not able to change to Dont Summarise also. this option itself is not showing. 

Could anyone help me on this ?

I am new to power Bi, Step by step process of explanation will be much helpful.

Thanks in Advance 😀

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Akshay_Aso- ;

Unfortunately, that seems unlikely at the moment. The problem is that metrics that do not return integer or decimal values cannot be used as values in bar/line charts.

The best thing you can do right now is to add metrics as a tooltip.

So, given a metric [Duration in Seconds] that returns an integer or decimal value, create a new metric:

1.change to seconds

second = var _hour= CONVERT( LEFT(MAX('Table'[DateTime.2]), FIND(":",MAX('Table'[DateTime.2]),1)-1),INTEGER)
var _min= MID( MAX('Table'[DateTime.2]), FIND(":",MAX('Table'[DateTime.2]),1)+1,2)
var _sec= RIGHT(MAX('Table'[DateTime.2]),2)
return _hour*3600+_min*60+_sec

2.averge the seconds every month. then change it to hour.

aver = AVERAGEX(FILTER(ALL('Table'),EOMONTH([DateTime.1],0)=EOMONTH(MAX('Table'[DateTime.1]),0)),[second]) /3600

3.format it to hh:mm:ss as tooltip

formatave = 
INT([aver])
&":"&INT(([aver]*3600-INT([aver])*3600)/60)
&":"&FORMAT( INT( MOD([aver]*3600,60)),"00")

The final output is shown below:

vyalanwumsft_0-1642055324720.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Akshay_Aso- ;

Unfortunately, that seems unlikely at the moment. The problem is that metrics that do not return integer or decimal values cannot be used as values in bar/line charts.

The best thing you can do right now is to add metrics as a tooltip.

So, given a metric [Duration in Seconds] that returns an integer or decimal value, create a new metric:

1.change to seconds

second = var _hour= CONVERT( LEFT(MAX('Table'[DateTime.2]), FIND(":",MAX('Table'[DateTime.2]),1)-1),INTEGER)
var _min= MID( MAX('Table'[DateTime.2]), FIND(":",MAX('Table'[DateTime.2]),1)+1,2)
var _sec= RIGHT(MAX('Table'[DateTime.2]),2)
return _hour*3600+_min*60+_sec

2.averge the seconds every month. then change it to hour.

aver = AVERAGEX(FILTER(ALL('Table'),EOMONTH([DateTime.1],0)=EOMONTH(MAX('Table'[DateTime.1]),0)),[second]) /3600

3.format it to hh:mm:ss as tooltip

formatave = 
INT([aver])
&":"&INT(([aver]*3600-INT([aver])*3600)/60)
&":"&FORMAT( INT( MOD([aver]*3600,60)),"00")

The final output is shown below:

vyalanwumsft_0-1642055324720.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-yalanwu-msft for the help. 👍

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.