Forum Discussion

Killingworth's avatar
Killingworth
Regular Visitor
6 years ago
Solved

Working Days

I have two tables

 

1. With raw data of interactions broken down by date

 

2. Date table with all dates of the year with an indicator if the day is a working day or not.

 

I have a measure which gives me the number of working days in each month but how do I get the number of working days worked to the current date

 

i.e this month to date they have been 9 workings days

  • ryan_mayu's avatar
    ryan_mayu
    6 years ago

    Killingworth 

     

    please try this

    THISMONTHWORKDAY = 
    CALCULATE(COUNTROWS('DATE'),FILTER('DATE','DATE'[Date]<=TODAY()&&'DATE'[WORKDAY2]="WEEKDAY"))

     

5 Replies

  • Killingworth 

     

    It will be better that you share your measure and the sample data.

     

    THISMONTHWORKDAY = 
    VAR mth=MONTH(TODAY())
    VAR yr=YEAR(today())
    RETURN CALCULATE(COUNTROWS('DATE'),FILTER('DATE',YEAR('DATE'[Date])=yr&& MONTH('DATE'[Date])=mth&&'DATE'[Date]<=TODAY()&&'DATE'[WORKDAY2]="WEEKDAY"))

    Since my local time is about 1 am, my workday is 10 for this month.

    • Killingworth's avatar
      Killingworth
      Regular Visitor

      That gives me the number of working days complete in the current month but if I filter the data for previous months it doesn't give the amount of working days complete in the filtered month ?

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        Killingworth 

         

        please try this

        THISMONTHWORKDAY = 
        CALCULATE(COUNTROWS('DATE'),FILTER('DATE','DATE'[Date]<=TODAY()&&'DATE'[WORKDAY2]="WEEKDAY"))