Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

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

 

 

 

idea.png

1 ACCEPTED SOLUTION

Hi @Anonymous

 

You may refer to below post. If you need further help, please share the .pbix file for us to provide an accurate solution.You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

https://community.powerbi.com/t5/Desktop/Cumulative-sum-of-a-measure/td-p/270358

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-cherch-msft
Microsoft Employee
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

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 😞

 

Capture.JPG

Hi @Anonymous

 

You may refer to below post. If you need further help, please share the .pbix file for us to provide an accurate solution.You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

https://community.powerbi.com/t5/Desktop/Cumulative-sum-of-a-measure/td-p/270358

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

How are you minusing off past staff? Can you post that formula?

 

Sample data would help tremendously but I am guessing that it has something to do with your past staff only being in "scope" for that first set. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
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"

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.