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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
po
Post Prodigy
Post Prodigy

filter a table to get times in certain range

Hi,

 

Have a table with dates in it (date and time) how can we best filter this table to only include those rows where the time is between midnight and 10.00 a.m and then get the maximimum of those rows?

 

Thanks 

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @po 

You may create date and time columns as requested.Then use the above mentioned workaround.

1.png

Regards,

Community Support Team _ Cherie Chen
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

4 REPLIES 4
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @po 

You may try below measures:

Filter =
IF (
    MAX ( 'Table'[Time] ) <= TIME ( 10, 0, 0 )
        && MAX ( 'Table'[Time] ) >= TIME ( 0, 0, 0 ),
    1
)
Max_time =
VAR max_time =
    CALCULATE (
        MAX ( 'Table'[Time] ),
        FILTER ( ALLEXCEPT ( 'Table', 'Table'[Date] ), [Filter] = 1 )
    )
RETURN
    IF ( MAX ( 'Table'[Time] ) = max_time, MAX ( 'Table'[Time] ) )

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi 

 

Thanks for reply.

Aplogies - I didn't make clear the data and time are one column e.g 01/05/2019 09:00:00

 

Thanks

v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @po 

You may create date and time columns as requested.Then use the above mentioned workaround.

1.png

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for update

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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