Reply
Kareus
Helper I
Helper I
Partially syndicated - Outbound

Running Total Help

How can I determine the first intance the running total is less than or equal to 0?

 

In this case I want the result to be 6.

As its the first week that is non-zero.

 

Kareus_0-1708988967210.png

 

Thank you!

 

1 ACCEPTED SOLUTION

Syndicated - Outbound

Hi,

This measure works

Measure = COUNTROWS(FILTER(VALUES('Resource Priority'[RT Good Week]),[10K 2PLD RT]>0))+1

Hope this helps.

Ashish_Mathur_0-1709003627216.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

16 REPLIES 16
Ashish_Mathur
Super User
Super User

Syndicated - Outbound

Hi,

Why should the answer be 6?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Kareus_0-1708991181525.png

 

Syndicated - Outbound

That is the first instance when the RT is <0.  In your original post, you mentioned that you wanted to know the first instance when the RT is >0.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

You are correct, I mispoke.  I'll fix it in the original request.

Syndicated - Outbound

Share the download link of the PBI file with the RT measure already written.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound
Here is my RT measure ...

10
K 2PLD RT = SWITCH(TRUE(),
CALCULATE(SUM('Resource Priority'[10K 2PLD])-('Manual Inputs'[VALUE Weekly 10k]*([MEASURE RT Good Week Count])),
    FILTER(ALLSELECTED('Resource Priority'[RT Good Week]), ISONORAFTER('Resource Priority'[RT Good Week], MAX('Resource Priority'[RT Good Week]), DESC))) >= -[VALUE Weekly 10k],

    [Week Position %]*'Manual Inputs'[VALUE Weekly 10k]+
    CALCULATE(SUM('Resource Priority'[10K 2PLD])-('Manual Inputs'[VALUE Weekly 10k]*([MEASURE RT Good Week Count])),
    FILTER(ALLSELECTED('Resource Priority'[RT Good Week]), ISONORAFTER('Resource Priority'[RT Good Week], MAX('Resource Priority'[RT Good Week]), DESC))),

    CALCULATE(SUM('Resource Priority'[10K 2PLD])-('Manual Inputs'[VALUE Weekly 10k]*([MEASURE RT Good Week Count]))
))

Syndicated - Outbound

I'll need the file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Sorry, stupid question.  How do I share it?

 

Kareus_0-1709002538827.png

 

Syndicated - Outbound

Google Drive/One Drive.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Google Drive It Is

Syndicated - Outbound

Hi,

This measure works

Measure = COUNTROWS(FILTER(VALUES('Resource Priority'[RT Good Week]),[10K 2PLD RT]>0))+1

Hope this helps.

Ashish_Mathur_0-1709003627216.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Works, for counting ALL dates less than or equal to zero.

 

BUT, I'm looking for the number of weeks to the FIRST and only the FIRST negative value.

https://drive.google.com/file/d/1BnqZDDm8UjoIObpoM-m5tWv31EwLx-K6/view?usp=sharing

 

Kareus_0-1709006191066.png

 

 

Syndicated - Outbound

I do nto understand your expected result.  Show that very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

I'm trying to figure out the periods of time (weeks) to the green box of each running total.

 

For the Wide RT column.  Your formula is returning 3.  It should be 1 as the frist row is negative.

I listed the correct answer in green below the "Lead Time - Weeks" table.

 

Kareus_0-1709036007434.png

 

Syndicated - Outbound

Hi,

I can try but before that you will need to create a Calendar Table in the file with a week column in there.  Create a relationship (Many to One and Single) from the Good Build Date column to the Date column of the Calendar Table.  Share the download link of the revised PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Syndicated - Outbound

Does this reply above make sense Ashish?

 

This YouTube video is a really close solution, but my Running Total is a measure.

So CALCULATEDTABLE(VALUES (Sales[Order Date]), ALLSELECTED()) does work from the video.

Counting consecutive days with sales - Unplugged #47 (youtube.com)

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)