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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sclencioco
Helper I
Helper I

line graph including time difference as y axis

Hello,

 

Can you help me create a visualization(line graph) with time difference on Y-Axis and Date on X-axis. Below is my data for your reference

 

Capture062717.JPG

8 REPLIES 8
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @sclencioco,

 

If I understand correctly, you need to show the values of column [time diff] on Y-axis, grouped on date column which is added on X-axis, right?

 

Actually, it is not possible to achieve that. Because Y-axis only supports numeric values. If you add time value or text value, it will show Count/Count(distinct) value by default. In your scenario, you could convert your time diff to seconds or hours, then add it to Y-axis.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

So I need to split start_on and end_on to get the date and time to be used on line graph?

Hi @sclencioco,

 

I noticed that there is a column named as [time diff] in source table, you could convert its values from HH:MM:SS to integer (seconds/hours/minutes).

 

 

To add date values on X-axis, you could extract the date part from date/time first.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

I created [time diff] as MEASUREMENT. How can I make it an integer? Using Data type will do?

 

Thank you.

Saldie

Hi @sclencioco,

 

Have you resolved the problem now? If so, would you please kindly mark the corresponding reply as an answer or sharing your resolution so that it can benefit more users? If you still have any question, please feel free to ask.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @sclencioco,

 

Not sure how you created the measure for [time diff]. But you could try this to calculate the time difference in hours/minutes/seconds.

 

Hour diff = DATEDIFF(MAX(Table_name[START_ON]),MAX(Table_name[END_ON]),HOUR)

Minute diff = DATEDIFF(TMAX(able_name[START_ON]),MAX(Table_name[END_ON]),MINUTE)

Second diff = DATEDIFF(MAX(Table_name[START_ON]),MAX(Table_name[END_ON]),SECOND)

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

@sclencioco  what are you actually asking for, have you not tried to do this yourself?  what are you struggling with exactly?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hello, I tried it but i can not get my expected output.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.