Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
iamriz
Helper II
Helper II

How to get hourly aggregate counts and show on a Weekly Calendar/Table Visual?

Hello, I want to get the hourly aggregate counts and show them on a weekly Calendar/Table visual same as below screenshot.

Sample Week CalendarSample Week Calendar

I would appreciate if anyone can help give tips on how to best achieve this.

Thank you.

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@iamriz ,

You need split date into two part date and time

 

Date = [date time].date

join with date calendar having week info

Time = [date time].time

and join with time calendar having hour bucket

 

Time calendar :https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/

week calendar : https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

WeekDay Name = FORMAT([Date],"ddd")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

View solution in original post

vanessafvg
Super User
Super User

is this what you looking for? see attached





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

v-yingjl
Community Support
Community Support

Hi @iamriz ,

Create two calculated columns and one measure can achieve this:

Calculated columns:

Time = TIME(HOUR('Sample_data'[Datetime]),0,0)
Day = FORMAT(DAY('Sample_data'[Datetime]),"dddd")

Measure:

Result = COUNTROWS('Sample_data')

Use a Matrix to show the result:

time result.png

 

Attached sample file that you can refer: How to get hourly aggregate counts.pbix

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yingjl
Community Support
Community Support

Hi @iamriz ,

Create two calculated columns and one measure can achieve this:

Calculated columns:

Time = TIME(HOUR('Sample_data'[Datetime]),0,0)
Day = FORMAT(DAY('Sample_data'[Datetime]),"dddd")

Measure:

Result = COUNTROWS('Sample_data')

Use a Matrix to show the result:

time result.png

 

Attached sample file that you can refer: How to get hourly aggregate counts.pbix

 

Best Regards,
Yingjie Li

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

vanessafvg
Super User
Super User

is this what you looking for? see attached





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




amitchandak
Super User
Super User

@iamriz ,

You need split date into two part date and time

 

Date = [date time].date

join with date calendar having week info

Time = [date time].time

and join with time calendar having hour bucket

 

Time calendar :https://kohera.be/blog/power-bi/how-to-create-a-time-table-in-power-bi-in-a-few-simple-steps/

week calendar : https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

WeekDay Name = FORMAT([Date],"ddd")

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

vanessafvg
Super User
Super User

can you share some of your data in text form?




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors