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

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

Reply
CalleWagenaar
Frequent Visitor

How to create a bar chart using start and end times.

I have another questin now. I am trying to create a graph showing how many cars are drving at a certain hour. To do this I have start times and end times in my data.  have created a time frequancy graph based on start times, which shows how many cars start at a certain time: 

CalleWagenaar_0-1671808764044.png

 

However this only shows the start times. How do I geth this graph to show the time inbetween the stat and the end time. For example: 
If a car drove from 10:00 -13:00 using only strta times it adds one point to 10:00. I need it to add a point to 10:00, 11:00 and 12:00. How can I do this? 

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

Hi @CalleWagenaar ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1672368336547.png

Please try:

First create a new time table:

vjianbolimsft_1-1672368435676.png

Then create a measure:

Measure = SUMX('Table',IF([Start Time]<=MAX('Time'[Time])&&[End Time]>=MAX('Time'[Time]),1))

Apply it to the visual:

vjianbolimsft_2-1672368473548.png

Final output:

vjianbolimsft_3-1672368488194.png

Best Regards,

Jianbo Li

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

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @CalleWagenaar ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1672368336547.png

Please try:

First create a new time table:

vjianbolimsft_1-1672368435676.png

Then create a measure:

Measure = SUMX('Table',IF([Start Time]<=MAX('Time'[Time])&&[End Time]>=MAX('Time'[Time]),1))

Apply it to the visual:

vjianbolimsft_2-1672368473548.png

Final output:

vjianbolimsft_3-1672368488194.png

Best Regards,

Jianbo Li

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

This doesn't work for me, when I follow the step there are no errors. However when I try to create the graph it is blank.

I exactly followed your steps with your exact data and there is still no resut

lbendlin
Super User
Super User

In Power Query you can use List.Generate to create the time series for each car (with hourly granularity), from Start date/hour to end date/hour.  Then you can use these calculated data points in your visual.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.