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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.