Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

minus from cumulative

Hello all,

 

I’ve been struggling all day on this and can’t find a solution.

I’m trying to work out how many workers my factory needs in the future.  I have a total each week that we need, [Weeks backlog efficiency Zoned] and a running total of the number of workers needed [Cumulative], but I want to minus off each value the number of workers we have [Past Staff] .  because we are behind I need to have a cumulative total and move what’s left to be made over into spare capacity next week ect hence the running total.

 

Cumulative =

CALCULATE([Weeks backlog efficiency Zoned],

   FILTER(ALL('Future Orders'[Yearweek Backlog 2-5]),VALUE('Future Orders'[Yearweek Backlog 2-5]) <= VALUE(MAX('Future Orders'[Yearweek Backlog 2-5]))))

 

When I minus off the number of workers [paststaff] it only takes it off the first week not every week so I end up with a growing number

 

 

 

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi thanks for the reply. I think your right about the scope, however even if I type in minus 7 it only takes it off the first week so I need to write something that repeats the process.  the past staff formula is below, it simply works out the full time days worked including overtime over the last 5 weeks.   Labour(2) is not linked to the date that the rest of the sheet uses. 

       

      "PastStaff= (
      IF('D Labour (2)'[Time period]="last5week",
      IF('D Labour (2)'[Type of work] = "NoOfHeads",'D Labour (2)'[Value]*8,
      IF('D Labour (2)'[Type of work]="Hrs Overtime",'D Labour (2)'[Value],0)
      ))/5)/37"
  • Anonymous's avatar
    Anonymous
    Not applicable

    I have made a cumulative Colum of the Work which needs doing:

    Cummulative work =

    (CALCULATE([Weeks backlog efficiency Zoned]    ,

        FILTER(ALL('Future Orders'[Yearweek Backlog 2-5]),VALUE('Future Orders'[Yearweek Backlog 2-5]) <= VALUE(MAX('Future Orders'[Yearweek Backlog 2-5])))))

     

    and the difference between the Labour we have and the Labour we need:

     

    +/- staff = [Weeks backlog efficiency Zoned]-SUM('D Labour (2)'[Past Staff])

     

    this sits nicely in each “Yearweek Backlog 2-5”.  now all I need is a cumulative total of the +/-staff but it doesn’t work :(

     

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi Anonymous

     

    Could you tell me if your problem has been solved? If it is,kindly mark the helpful answer as a solution and welcome to share your own solution. More people will benefit from here. If not, please share more details for us so that we could help further on it.

     

    Regards,

    Cherie