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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors