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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How can I create a line chart with duration calculations?

I have these measures:

 

Total_ACW = FORMAT(('All_NICE_Data'[Total_Handle_Time] - 'All_NICE_Data'[Total_Talk_Time]),"HH:MM:SS")
Total_Handle_Time = FORMAT(SUM(All_NICE_Data[Handle Time]),"HH:MM:SS")
Total_Talk_Time = FORMAT(SUM(All_NICE_Data[Talk Time]),"HH:MM:SS")
 
I want to be able to use any of these in a line chart to track calculations by day, week, or month in a line chart.  Power BI will not allow me to use them.
 
This is call center data and we need to be able to see these stats, what can I do to make this work better?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I think the challenge you're facing stems from the fact that the FORMAT function converts your measures into text strings, which cannot be directly used in line charts as they require numeric values to plot the data points.

You can change your DAX codes.

 

Total_ACW_Seconds = SUM('All_NICE_Data'[Total_Handle_Time]) - SUM('All_NICE_Data'[Total_Talk_Time])
Total_Handle_Time_Seconds = SUM('All_NICE_Data'[Handle Time])
Total_Talk_Time_Seconds = SUM('All_NICE_Data'[Talk Time])

 

Then you can use it in the line chart and you can change the format as you like.

 

Total_ACW_HH_MM_SS = 
VAR TotalSeconds = [Total_ACW]
RETURN FORMAT(TotalSeconds / 86400, "HH:MM:SS")

 

vyilongmsft_0-1713406153913.png

 

 

 

Best Regards

Yilong Zhou

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

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

I think the challenge you're facing stems from the fact that the FORMAT function converts your measures into text strings, which cannot be directly used in line charts as they require numeric values to plot the data points.

You can change your DAX codes.

 

Total_ACW_Seconds = SUM('All_NICE_Data'[Total_Handle_Time]) - SUM('All_NICE_Data'[Total_Talk_Time])
Total_Handle_Time_Seconds = SUM('All_NICE_Data'[Handle Time])
Total_Talk_Time_Seconds = SUM('All_NICE_Data'[Talk Time])

 

Then you can use it in the line chart and you can change the format as you like.

 

Total_ACW_HH_MM_SS = 
VAR TotalSeconds = [Total_ACW]
RETURN FORMAT(TotalSeconds / 86400, "HH:MM:SS")

 

vyilongmsft_0-1713406153913.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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