cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Filter Time

Hi!

 

So i made the average time that takes to appointment a booking. But now i have to apply filters, that are the following ones:

- only matters monday to friday;

- between 8h and 19h.

 

here's the table:

 

170323003_0-1597052081223.png

 

here's the measure i used to AVG:

TmMRespostaHHMMSS = AVERAGE(Reserves[Date Diff])

 

(

DataDiff is a column i made with 

Data Diff = DATEDIFF(Reserves[Date Booking], Reserves[Date],HOUR)
)
 
How do i apply those filters i mentioned before?
 
TY!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Filter Time

Hi @170323003 ,

 

We can't add measure to page -level filter, just change the measure to the column:

 

Measure =
VAR weekdayb =
    WEEKDAY ( Reserves[Date Booking], 2 )
VAR weekdayr =
    WEEKDAY ( Reserves[Date], 2 )
RETURN
    IF (
        weekdayb - 6 < 0
            && weekdayr - 6 < 0
            && HOUR ( Reserves[Date Booking] ) >= 8
            && HOUR ( Reserves[Date Booking] ) <= 19
            && HOUR ( Reserves[Date] ) >= 8
            && HOUR ( Reserves[Date] ) <= 19,
        1,
        0
    )

 

 

add it to the page level filter and  set it 'is equal to'1

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

View solution in original post

4 REPLIES 4
Highlighted
Super User IX
Super User IX

Re: Filter Time

@170323003 , you have to create a date table and take only weekday diff

refer 2nd page of this file

https://www.dropbox.com/s/y47ah38sr157l7t/Order_delivery_date_diff.pbix?dl=0



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Microsoft
Microsoft

Re: Filter Time

Hi @170323003 ,

 

Are you trying to filter the booking date or reserve date in weekday and between 8:00am and 7:00pm? If so , please refer to the measure below and add it to the table level filter:

 

 

Measure =
VAR weekdayb =
    WEEKDAY ( MAX ( Reserves[Date Booking] ), 2 )
VAR weekdayr =
    WEEKDAY ( MAX ( Reserves[Date] ), 2 )
RETURN
    IF (
        weekdayb - 6 < 0
            && weekdayr - 6 < 0
            && HOUR ( MAX ( Reserves[Date Booking] ) ) >= 8
            && HOUR ( MAX ( Reserves[Date Booking] ) ) <= 19
            && HOUR ( MAX ( Reserves[Date] ) ) >= 8
            && HOUR ( MAX ( Reserves[Date] ) ) <= 19,
        1,
        0
    )

 

 

set the filter to 'is equal to'1

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

Highlighted
Helper I
Helper I

Re: Filter Time

HI @v-deddai1-msft ,

 

Ty for ur answer, i think is that. Although, i can't add the filter. I mean, i add it but doesnt do nothing. 

170323003_0-1597141202099.png

 

I added the measure at right. I cant put her in the zone "filters on this page"!

 

TY

Highlighted
Microsoft
Microsoft

Re: Filter Time

Hi @170323003 ,

 

We can't add measure to page -level filter, just change the measure to the column:

 

Measure =
VAR weekdayb =
    WEEKDAY ( Reserves[Date Booking], 2 )
VAR weekdayr =
    WEEKDAY ( Reserves[Date], 2 )
RETURN
    IF (
        weekdayb - 6 < 0
            && weekdayr - 6 < 0
            && HOUR ( Reserves[Date Booking] ) >= 8
            && HOUR ( Reserves[Date Booking] ) <= 19
            && HOUR ( Reserves[Date] ) >= 8
            && HOUR ( Reserves[Date] ) <= 19,
        1,
        0
    )

 

 

add it to the page level filter and  set it 'is equal to'1

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors