Forum Discussion
Calculate working days from multiple rows on the same date
- 3 years ago
JoshuaMartinezP Try this. PBIX is attached below signature.
No. of Work Days = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Table', [TS is work day] = TRUE),"Date",[Date])))
JoshuaMartinezP Use NETWORKDAYS?
Hi Greg,
Thanks for the fast reply.
NETWORKDAYS requires me to specify holidays etc. It also gives me the total number of all 'work days' but I want only the work days that have been worked on, as indicated by my row data.
If I use the row data then I will only pull through the work days of the month that need to be counted. Which is why I am trying to use a CALCULATE filter.
Thanks,
- Greg_Deckler3 years agoCommunity Champion
JoshuaMartinezP Holidays is optional. If you can post sample data as text I can take a look.
- JoshuaMartinezP3 years agoRegular Visitor
Thank you, sample data as follows:
Date Hours TS Day Name TS is work day 03-Jan-23 3 Tuesday True 03-Jan-23 0.5 Tuesday True 03-Jan-23 4 Tuesday True 04-Jan-23 3 Wednesday True 04-Jan-23 4.5 Wednesday True 05-Jan-23 4 Thursday True 05-Jan-23 2 Thursday True 05-Jan-23 2 Thursday True 06-Jan-23 4 Friday True 06-Jan-23 4 Friday True 09-Jan-23 3 Monday True 09-Jan-23 1 Monday True 09-Jan-23 3 Monday True 10-Jan-23 3 Tuesday True 10-Jan-23 2 Tuesday True 10-Jan-23 1.5 Tuesday True 10-Jan-23 3 Tuesday True 11-Jan-23 3 Wednesday True 11-Jan-23 4 Wednesday True 11-Jan-23 0.25 Wednesday True 12-Jan-23 2.5 Thursday True 13-Jan-23 2 Friday True 13-Jan-23 3 Friday True 16-Jan-23 3.5 Monday True 16-Jan-23 4 Monday True 17-Jan-23 1 Tuesday True 17-Jan-23 6.5 Tuesday True 18-Jan-23 5 Wednesday True 18-Jan-23 2.5 Wednesday True 19-Jan-23 0.5 Thursday True 19-Jan-23 3 Thursday True 19-Jan-23 4 Thursday True 20-Jan-23 3 Friday True 20-Jan-23 4 Friday True - Greg_Deckler3 years agoCommunity Champion
JoshuaMartinezP Wait a minute, is that third calculation a calculated column or a measure? Because if it is a calculated column generally does not work with measures because the calculated column only gets calculated at the time of data load.