cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## Graph the hour of the day

I have table of customers that has these data

CustomerID, DemandHour, PurchaseHour

1001              15                   19

1002              03                   07

1003              19                   07

1004              23                   19

1005              15                   19

1006              23                   16

1007              15                   10

I want to find the count of customers of each hour

I want to graph them to look like this

How Can I do that ???

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Graph the hour of the day

Hi @AkrMus ,

You can create a table with 24 hours(0~24), then write two measure to check table records if records time field are same as current hour label.

```PC =
CALCULATE (
COUNT ( T0[CustomerID] ),
FILTER ( ALLSELECTED ( T0 ), [PurchaseHour] = MAX ( 'Hour'[Value] ) )
)

DC =
CALCULATE (
COUNT ( T0[CustomerID] ),
FILTER ( ALLSELECTED ( T0 ), [DemandHour] = MAX ( 'Hour'[Value] ) )
)
```

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
Community Support Team

## Re: Graph the hour of the day

Hi @AkrMus ,

You can create a table with 24 hours(0~24), then write two measure to check table records if records time field are same as current hour label.

```PC =
CALCULATE (
COUNT ( T0[CustomerID] ),
FILTER ( ALLSELECTED ( T0 ), [PurchaseHour] = MAX ( 'Hour'[Value] ) )
)

DC =
CALCULATE (
COUNT ( T0[CustomerID] ),
FILTER ( ALLSELECTED ( T0 ), [DemandHour] = MAX ( 'Hour'[Value] ) )
)
```

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

#### Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors