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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PAD
Regular Visitor

Count the number of occurances in any give hour using DAX

How are you guys. I have a dataset where I want to count the numver of events happening in any given hour. The objective is to find the hour or period with many events. for example:

A table with date, hour and event columns. I would to pick the hour (between 00:00 & 23:59) which has a lot of activity regardless of the date. Below is a dataset screenshot

PAD_0-1671183338342.png

 

 

PAD_1-1671183601081.png

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @PAD ,

 

Please try:

First create a parameter:

vjianbolimsft_0-1672214784564.png

Then apply the measure:

Measure = CALCULATE(COUNT('Table'[Time]),FILTER('Table',HOUR([Time])=SELECTEDVALUE(Parameter[Parameter])))

Final output:

vjianbolimsft_1-1672214844252.png

Best Regards,

Jianbo 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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @PAD ,

 

Please try:

First create a parameter:

vjianbolimsft_0-1672214784564.png

Then apply the measure:

Measure = CALCULATE(COUNT('Table'[Time]),FILTER('Table',HOUR([Time])=SELECTEDVALUE(Parameter[Parameter])))

Final output:

vjianbolimsft_1-1672214844252.png

Best Regards,

Jianbo Li

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

JorgePinho
Solution Sage
Solution Sage

Hello @PAD !

 

You can create bins on the hour column. See this article: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-grouping-and-binning

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors