Forum Discussion
Excluding weekends from the difference of dates.
HI Dunner2020
It is missing Dates[IsHoliday] column.
Anonymous ,
That's strange. Because I can see IsHoliday column. IsHoliday contains either False or True Values.In the sample, all values of IsHoliday is false except one date i.e. 15/1/2019
- Anonymous6 years agoNot applicable
HI Dunner2020
My bad, I didn't scroll to the right.
I got 22 as a result. My [Is Holiday] column is Text and used the below formula. You can change the [start date], [end date] and make sure they are in the correct format and compared with Dates[Date] column.
Difference in days = CALCULATE( COUNTROWS(Dates), FILTER(ALL(Dates) , Dates[Date] >= DATE(2019,01,01) && Dates[Date] <= date(2019,01,31) && Dates[IsHoliday] = "FALSE" && (Dates[Day Of Week Name] <> "Saturday" && Dates[Day Of Week Name] <> "Sunday") ) )- Greg_Deckler6 years ago
Community Champion
Dunner2020 - I like Anonymous 's solution, I do want to point out that Net Work Days was invented to solve this kind of thing. https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362#M109
- Dunner20206 years ago
Post Prodigy
Anonymous , When I ran your code, visualization did not work. I think the reason might be ISHoliday is a calculated column Which has either value 'False' or 'True'. In my code, I was checking holiday condition like date[ISHoliday]=False(), which you changed it to date[ISHoliday]="FALSE".