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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sparkplug93751
Helper II
Helper II

Filtering Out Weekends in Column

Hello,

 

I have a table that lists all clock ins/outs per person. There's less people working on the weekend but we still want them counted.

 

For our reporting, we use the average of the 5 weekdays.

 

The goal is to show a measure that is ALL days, including weekends, and a filter that will let you toggle between all days and turning off the weekend. 

 

I need it to look like: Remove Weekends? Where no is all days and yes removes the weekend to show just weekdays

 

Thanks!

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @sparkplug93751 

 

Based on your description, I created data to reproduce your scenario.

Table:

c1.png

 

Test:

c2.png

 

You may create a measure as below.

 

 

IsDisplay = 
var _flag = SELECTEDVALUE(Test[IsRemoveWeekend])
var _isworkday = WEEKDAY(SELECTEDVALUE('Table'[Date]))
return

    IF(
        _flag = "no",
        1,
        IF(
            _flag = "yes"&&NOT(_isworkday in {1,7}),
            1
        )
    )

 

 

 

You need to put the measure in the visual level filter and here is the result.

 

c3.png

c4.png

 

Best Regards

Allan

 

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

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @sparkplug93751 

 

Based on your description, I created data to reproduce your scenario.

Table:

c1.png

 

Test:

c2.png

 

You may create a measure as below.

 

 

IsDisplay = 
var _flag = SELECTEDVALUE(Test[IsRemoveWeekend])
var _isworkday = WEEKDAY(SELECTEDVALUE('Table'[Date]))
return

    IF(
        _flag = "no",
        1,
        IF(
            _flag = "yes"&&NOT(_isworkday in {1,7}),
            1
        )
    )

 

 

 

You need to put the measure in the visual level filter and here is the result.

 

c3.png

c4.png

 

Best Regards

Allan

 

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

Greg_Deckler
Super User
Super User

Use WEEKNUM([Column],2) and you wan those < 6. See https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362#M109


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi, so when I use this in a slicer. How would I structure it?

 

Would it be the dax you sent where those less than 6 are "Yes" and Those not are "No"? 

 

I need the Yes option to show all 7 days and the No option to Only show the 5 workdays. I've isolated the weekend with a yes no using weekday but when the answer is "Yes" it only selects those that are Saturday or Sunday vs all 7 days

 

Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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