cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MicaelaTantum
Frequent Visitor

Running Calculation (Date part will run out)

Hello 😁

 

I would like some help with cracking a running total formula that I have been struggling with for a while. 

 

I basically need to show when each part number will run out... 

These are my columns; 

  • OH ( on hand) quanity which we have on site. 
  • Req QTY ( Required total amount ) which tells me how many of this part we need
  • Item which are the part numbers 
  • Sales Order which is a unique product number where the part will be build on 
  • Actual Lauch Date which tells me when the product will be used in the factory 

I have added these columns into a table to visualise.

 
 

powerbihelp.png

 

I would like another column on the end which will take the total amount of this part number (131,306.00) and take each row away from the total. Once it reaches 0, i will then create some sort of visual to highlight the actual launch date. 

I have tried a few rolling total formulas but it does not want to take the total amount and subtract it, instead it seems to formulate a row at a time.

 

Any suggestions/ help will be appreciated

 

 

Kind regards, 

 

Micaela 🤓

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @MicaelaTantum ,

 

"I would like another column on the end which will take the total amount of this part number (131,306.00) and take each row away from the total. Once it reaches 0, i will then create some sort of visual to highlight the actual launch date. "

Create measures like this:

Measure 3 = 
CALCULATE(
    SUM(Sheet4[REQD_QTY]),
    FILTER(
        ALLSELECTED(Sheet4),
        Sheet4[Sales Order] <= MAX(Sheet4[Sales Order])
    )
)
Measure 4 = 
CALCULATE(
    SUM(Sheet4[REQD_QTY]),
    ALL(Sheet4)
)
Measure 5 = [Measure 4] - [Measure 3]

Result picture 

 

Best regards,
Lionel 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

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @MicaelaTantum ,

 

"I would like another column on the end which will take the total amount of this part number (131,306.00) and take each row away from the total. Once it reaches 0, i will then create some sort of visual to highlight the actual launch date. "

Create measures like this:

Measure 3 = 
CALCULATE(
    SUM(Sheet4[REQD_QTY]),
    FILTER(
        ALLSELECTED(Sheet4),
        Sheet4[Sales Order] <= MAX(Sheet4[Sales Order])
    )
)
Measure 4 = 
CALCULATE(
    SUM(Sheet4[REQD_QTY]),
    ALL(Sheet4)
)
Measure 5 = [Measure 4] - [Measure 3]

Result picture 

 

Best regards,
Lionel 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

Take a peak at Days of Supply: https://community.powerbi.com/t5/Quick-Measures-Gallery/Days-of-Supply/m-p/635656#M318


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors