Forum Discussion
Dynamic sum of Count based on selected date
Hii
I have a list of working days. my requirement is when we select jan 2 result should be 1 and when we select jan 3 result should be the sum of two working days(2) and when we select jan 8 then the result should be 5(sum of working days).....How to do this???
Thanks
3 Replies
- sanalytics
Super User
Don't understand your requirement..Please provide dummy data and your expected result, so that we can try.
Regards,
Snandy
- amitchandak
Super User
Do you have a holiday list? For weekends, You can use the weekday function and mark the holidays.
Working Day = IF('Compare Date'[WeekDay] =6 || 'Compare Date'[WeekDay]=7 ,0,1)You can sum up the above to get working days. This only weekend. If you can add holidays, then you can correct the working days.
you can also refer
https://community.powerbi.com/t5/Desktop/NETWORKDAYS-with-multiple-country-holidays/td-p/401636
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p/881739
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601 - Ashish_Mathur
Super User
Hi,
Create a Calendar Table and build a relationship from the Date column of your working days table to the Date column of your Calendar Table. Build the slicer from the Date column of the Calendar Table and select 2 January 2020 there. Write this measure
=CALCULATE(COUNTROWS('Working Days'),DATESBETWEEN(Calendar[Date],DATE(YEAR(MIN(Calendar[Date])),MONTH(MIN(Calendar[Date])),1)))
Hope this helps.