Forum Discussion

SteveMForm's avatar
SteveMForm
Icon for Helper III rankHelper III
2 years ago

Add a filter to a variable in a measure

Hi Folks

 

I'm trying to divide the output of a variable by a figure inside a measure.

 

The measure is as follows:

Capacity allocated = 
var a = SUMMARIZECOLUMNS('Resourcing'[Name],'Resourcing'[Start Date],'Resourcing'[End Date],'Resourcing'[Capacity],'dimDates'[Date])
var b = ADDCOLUMNS(a,"sm",if([Start Date]<=[Date] && [Date]<=[End Date],[Capacity]))
return sumx(b,[sm])

I was advised to filter either variable a or variable b by NETWORKDAYS. Not sure how to write this into the measure.

 

Overall the aim is to have a figure for each month of what capacity has been allocated. At the moment, using the variable above, it is producing a figure per month of what will be worked

 

 

The Y axis should only really go up to 40 at the max (1.0 as capacity= 1 member of staff), I have extended to show the stats for each month as they currently are

Thanks

5 Replies

  • Do you have enough information to feed the NETWORKDAYS function?  It needs to know what your definition of a weekend is, and you need to provide a reference to the holiday table.

     

    Alternatively your calendar table should have a flag "working day"  that you can use instead.

    • SteveMForm's avatar
      SteveMForm
      Icon for Helper III rankHelper III

      Hi lbendlin - great to see you

       

      The dimDates table has:

      Weekday - Sunday as 0, Monday as 1 etc, running through the week

      WeekdayWeekend - Weekday and Weekend choice

      IsBankHoliday - True or False choice

       

      I checked on one individual staff who had just one work item for a given month of 0.5 capacity allocated to work and her current monthly figure 'worked' is 10.5. This is not correct as the current measure is multiplying this 0.5 by the working days ie 21 x 0.5 = 10.5.

       

      The figure that staff (therefore the Y axis figure) should have for that month should be 0.5. 

       

      This should work the same if moving up a level to Deputy Director, and then without any column legend giving the whole teams capacity allocated for a given month, instead of multiplying the total capacity by the number of working days.

       

      If you could show how we amend the measure to correctly show capacity allocated instead of capacity 'worked', that would be great  lbendlin 

       

      Thanks

      • SteveMForm's avatar
        SteveMForm
        Icon for Helper III rankHelper III

        Hi Folks

         

        any suggestions on solving this most welcome!

         

        Thanks