Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Filter by current date and certain time

I am building a report which displays open orders. 

 

I am attempting to apply a date and time filter to only display orders taken BEFORE 3pm on the current day.

 

I am able to do this, manually, by applying a date time filter, inputting today's date and the time 3 pm.

 

However, I am hoping to automate this report. Is there a way to create a filter which always defaults to before 3pm on the CURRENT day?

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please new a measure like:

    Filter = 
    VAR _DAY_TIME = TODAY() + TIME(15,0,0)
    VAR _FILTER = IF(MAX('Calendar'[Date])<=_DAY_TIME,1)
    RETURN
    _FILTER

    and apply it to the filter.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much for your response,

       

      I created the measure and that worked fine however Power BI refuses to allow me to use the measure as a filter.

       

      When I attempt to drag it into the "Filter" section it won't stay

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        This is strange.🤔Can you tell me your steps?

        My steps are as follows: Select the visual ->  Drag the [Filter] measure to the filter tab -> Configure filters and apply.

        The first step in configuring the visual level filter requires a click on visual.

        Add a filter to a report in Power BI

         

        Best Regards,
        Gao

        Community Support Team

         

        If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

        How to get your questions answered quickly -- How to provide sample data