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
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
This worked!!! thanks a lot
I guess i need to go manually validate its giving me the right answer but it looks correct
Ill mark it as accepted solution once i validate
Appreciate it