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
Golfdos
New Member

Time graph in hours, minutes and seconds

I’ve an Excel with 5 rows. The results of a running race are the times when arriving at different points of the race in hour, minute and second format. Here's an example:

 

NameTime 1Time 2Time 3Time 4
James0:20:000:35:000:40:000:58:00
John0:15:000:25:000:36:000:47:00

In another tab I’ve a list of hours, minutes and seconds, all the possible ones from the second 0 to 1 hour.

 

In power bi I need to make a line graph where the X is all the time and the Y is each of the times of each of the participants of the race. How do I have to do it?

2 REPLIES 2
Anonymous
Not applicable

Hi rajendraongole1 ,thanks for the quick reply, I'll add more.

Hi @Golfdos ,

In Power BI, timestamp comparisons at the second level are not supported. So I think I should change the data type to "Text".

1.Use the following DAX expression to create columns

Time_1 = FORMAT([Time 1],"hh:nn:ss")
Time_2 = FORMAT([Time 2],"hh:nn:ss")

vzhouwenmsft_0-1731983395953.png

2.Use the following DAX expression to create a table

Time = ADDCOLUMNS(GENERATESERIES(1,3600,1),"Time",FORMAT(TIME(0,0,[Value]),"hh:nn:ss"))

3. Use the following DAX expression to create a measure

Measure = 
VAR _time = SELECTEDVALUE('Time'[Time])
VAR _result = COUNTROWS(FILTER('Table',[Time_1] = _time || [Time_2] = _time || [Time_3] = _time || [Time_4] = _time))
RETURN 
_result

4.Final output

vzhouwenmsft_1-1731983501103.png

 

Best Regards,
Wenbin Zhou

rajendraongole1
Super User
Super User

Hi @Golfdos - Generate a time table in Power BI using DAX. This table should include all possible times from 0:00:00 to 1:00:00 in 1-second intervals:

 

TimeTable =
ADDCOLUMNS(
    GENERATESERIES(0, 3600, 1), -- 3600 seconds (1 hour)
    "Time", TIME(0, 0, [Value]) -- Convert seconds to time format
)

rajendraongole1_1-1731950975040.png

 

 

Now create a relationship between the TimeTable[Time] column and the unpivoted Value column from your race data. This ensures that each race time can map to the seconds in the time table.

 

rajendraongole1_0-1731950849226.png

rajendraongole1_2-1731951072981.png

 

 

 

In the report view, create a Line Chart visualization.
Set:
X-Axis: TimeTable[Time].
Y-Axis: Use a calculated measure that aggregates the participants' times.





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

Proud to be a Super User!





Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors