cancel
Showing results for
Did you mean:
Frequent Visitor

## Simple Running Total

New to PBI.

I have 3 columns in a table visual, SKU #, Description and a Sum of forecasted inventory dollars. The column for forecasted inventory dollars is a calculated column (forecasted inventory dollars = x - y ).  I want to calculate a running total of the inventory dollars. I tried, Quick Meaures, Running totals on this column, however the result is the same as the inventory dollars column?  I've read through many post, and tried a few different methods, but can't quite find my answer.  Thanks for your time.

2 REPLIES 2
Community Support Team

## Re: Simple Running Total

Hi @carH ,

You may create measure like DAX below.

`running total measure = CALCULATE(SUM(Table1[forecasted inventory dollars]),FILTER(ALLSELECTED(DateDim),DateDim[Date] <= MAX(DateDim[Date])))`

Best Regards,

Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

## Re: Simple Running Total

Hi Amy - thanks for your reponse. I do not have date columns in my model (see red below from your example measure)

`running total measure = CALCULATE(SUM(Table1[forecasted inventory dollars]),FILTER(ALLSELECTED(DateDim),DateDim[Date] <= MAX(DateDim[Date])))`

This is an example of my table (SKU, Description, Price, ForcsastedInvDollars). I'm trying to add the running total column (seen below on the end in red).  As you can see there are no dates associated with this data set. This is a snapshot of a predetermined time in the future which is calculated outside this model. Please note, the full data set contains zero's, postive numbers and negative numbers within the coloumn forecasted inventory dollars. Thank so much for your help!

 SKU Description Price ForcastedInvDollars Running Total 12345 Example SKU Description 1 \$3.45 \$328 \$328 23571 Example SKU Description 2 \$12.99 \$310 \$638 10101 Example SKU Description 3 \$8.10 \$310 \$948 65651R2 Example SKU Description 4 \$1.05 \$277 \$1,225 X4555 Example SKU Description 5 \$2.99 \$0 \$1,225 12345 Example SKU Description 6 \$23.50 (\$40) \$1,185 67891 Example SKU Description 7 \$6.32 (\$46) \$1,139 78912B Example SKU Description 8 \$35.46 (\$75) \$1,064

I've tried Quick Measure's, Running total. here is the DAX created by using that option.

Net SurplusShortage running total in itemNbr =
CALCULATE(
SUM('stockposition_final'[Net SurplusShortage]),
FILTER(
ALLSELECTED('PBI ItemMasterAll'[itemNbr]),
ISONORAFTER('PBI ItemMasterAll'[itemNbr], MAX('PBI ItemMasterAll'[itemNbr]), DESC)
)
)

This is not working, the result is the same value from the forecastedInvDollars Column. Here's an example:

 SKU Description price forcastedInvDollars Running Total 12345 Example SKU Description 1 \$3.45 \$328 \$328 23571 Example SKU Description 2 \$12.99 \$310 \$310 10101 Example SKU Description 3 \$8.10 \$310 \$310

Thanks!

Announcements

Kudos to you if you earned one of these! Check your inbox for a notification.

#### Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

#### Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (1,272)