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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
am_i_really
Frequent Visitor

How to count all rows that contain a specific time value and above

Hi All,

 

I'm trying to write a measure that would allow me to count all the rows in a column that contain "11:00:00 AM" or any time before that. Table name is Master and column name is Order Time. 

 

am_i_really_0-1671724006829.png

 

Thank you in advance!

 

@po 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @am_i_really 

 

try like:
 
Measure =
COUNTROWS(
   FILTER(
      ALL(Master),
      Master[Order Time] <= 11/24
    )
)

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

Another method:

CALCULATE (
    COUNT ( Orders[Order Time] ),
    Orders[Order Time] <= TIME ( 11, 0, 0 )
)
FreemanZ
Super User
Super User

hi @am_i_really 

 

try like:
 
Measure =
COUNTROWS(
   FILTER(
      ALL(Master),
      Master[Order Time] <= 11/24
    )
)

Thank you, worked like a charm!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.