cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AkrMus Regular Visitor
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

 

 

P1.png

 

How Can I do that ???

 

Appreciate your help.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
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] ) )
)

10.png

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

View solution in original post

1 REPLY 1
Community Support Team
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] ) )
)

10.png

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

View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

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!

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?

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

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

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors