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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
CalleWagenaar
Frequent Visitor

How do I create a bar chart using start and end times.

Hi!
 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-1675352916641.png

 

 

However this only shows the start times. How do I get this graph to show the time inbetween the stat and the end times.
For example: 
If a car drove from 10:00 -13:00 using only start 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-zhangti
Community Support
Community Support

Hi, @CalleWagenaar 

 

You can try the following methods.

Sample data:

vzhangti_0-1675404779782.png

Add a table for time.

vzhangti_1-1675404815141.png

Measure =
CALCULATE ( COUNT ( 'Table'[Car] ),
    FILTER ( ALL ( 'Table' ),
        [Start Time] <= SELECTEDVALUE ( 'Time table'[Time] )
            && [End Time] >= SELECTEDVALUE ( 'Time table'[Time] )
    )
)

vzhangti_2-1675404917063.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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
CalleWagenaar
Frequent Visitor

this helps however it doesn't work with multiple days. How can you combine months?

v-zhangti
Community Support
Community Support

Hi, @CalleWagenaar 

 

You can try the following methods.

Sample data:

vzhangti_0-1675404779782.png

Add a table for time.

vzhangti_1-1675404815141.png

Measure =
CALCULATE ( COUNT ( 'Table'[Car] ),
    FILTER ( ALL ( 'Table' ),
        [Start Time] <= SELECTEDVALUE ( 'Time table'[Time] )
            && [End Time] >= SELECTEDVALUE ( 'Time table'[Time] )
    )
)

vzhangti_2-1675404917063.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.