Forum Discussion

CalleWagenaar's avatar
CalleWagenaar
Frequent Visitor
3 years ago
Solved

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 star...
  • v-zhangti's avatar
    3 years ago

    Hi, CalleWagenaar 

     

    You can try the following methods.

    Sample data:

    Add a table for time.

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

    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.