cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
surfingjoe Regular Visitor
Regular Visitor

Calculating Working Days correctly, but filter context for Month not working

https://app.powerbi.com/view?r=eyJrIjoiOGE4ZWU5ZjgtYzJhOS00MjkyLTkwN2UtNmNmM2RjYmU4YWEwIiwidCI6ImI1Y...

 

See link above for sample calendar that is calculating working days.

 

The Matrix visual demonstrates that my method of determining a working day less holidays if functionally working.  Example first day of the year is New Years Day which falls on a Monday, which would normally be a working day, however because it is a holday the matrix is showing as Zero for the first Monday of the year and a One for the second Monday of the year.  So determining a working day minus holidays is working in my Power BI sample.

 

However, when I create a Month Name as the filter context and count rows that are working days

Count working days = CALCULATE(COUNTROWS(dates),FILTER(dates,dates[isworkingday]=1))

the table filter context is not working, instead of the actual days of work per month, it is showing 255 days.

 

I'm a newbie to Power BI, excuse me if the answer is simple, but not obvious to me, need help

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Calculating Working Days correctly, but filter context for Month not working

Hi surfingjoe,

Try just using SUM.

 

Count working days = SUM(dates[isworkingday])

 

Tell us if works for you.

 

View solution in original post

2 REPLIES 2
Highlighted
Anonymous
Not applicable

Re: Calculating Working Days correctly, but filter context for Month not working

Hi surfingjoe,

Try just using SUM.

 

Count working days = SUM(dates[isworkingday])

 

Tell us if works for you.

 

View solution in original post

surfingjoe Regular Visitor
Regular Visitor

Re: Calculating Working Days correctly, but filter context for Month not working

Never thought to simply use SUM.  Normal thought process is towards counting the working days, but since each true workinday is represented by a 1 and non working days represented by 0, then using SUM works.  Thank you.

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors