cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 66 members 1,251 guests
Please welcome our newest community members: