Forum Discussion
Ticket Data Average per hour by weekday
- 1 year ago
Hi theBlessedCobba,
Extract the weekday and hour from your timestamp column.
Group data by weekday and hour.
Count the number of tickets in each group for each day.
Calculate the average count per hour per weekday over the entire year (or 12 months).
Hour = HOUR('Tickets'[ticket_time])
Weekday = FORMAT('Tickets'[ticket_time], "dddd") -- Full weekday name
TicketsPerHour = COUNT('Tickets'[ticket_id])
DailyHourCounts =
SUMMARIZE(
'Tickets',
'Tickets'[Date], -- assuming you have a Date column or create one with DATE('ticket_time')
'Tickets'[Hour],
'Tickets'[Weekday],
"CountTickets", COUNTROWS('Tickets')
)AverageTicketsPerHour =
AVERAGEX(
FILTER(
DailyHourCounts,
DailyHourCounts[Hour] = SELECTEDVALUE('Tickets'[Hour]) &&
DailyHourCounts[Weekday] = SELECTEDVALUE('Tickets'[Weekday])
),
DailyHourCounts[CountTickets]
)Create a matrix visual in Power BI:
Rows: Hour
Columns: Weekday
Values: AverageTicketsPerHour measure
One last Question,
Is there a way for the data to be sorted Mon > Sun? i cant seem to get it to work
Hey theBlessedCobba,
Create a Sort Table, for example
Day Name Day Order
Monday 1
Tuesday 2
Wed 3
....
Click on your Sort Table column Day Name and sort it using Day Order
Connect this table to your other table with a relationship
Use Day Name from your Sort Table in the final visualization