cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
carH Frequent Visitor
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
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])))

If I misunderstood it, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

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

carH Frequent Visitor
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 DescriptionPrice ForcastedInvDollarsRunning Total 
12345Example SKU Description 1$3.45$328$328
23571Example SKU Description 2$12.99$310$638
10101Example SKU Description 3$8.10$310$948
65651R2Example SKU Description 4$1.05$277$1,225
X4555Example SKU Description 5$2.99$0$1,225
12345Example SKU Description 6$23.50($40)$1,185
67891Example SKU Description 7$6.32($46)$1,139
78912BExample 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:

 

SKUDescriptionpriceforcastedInvDollarsRunning Total 
12345Example SKU Description 1$3.45$328$328
23571Example SKU Description 2$12.99$310$310
10101Example SKU Description 3$8.10$310$310

 

Thanks!

 

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

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

Microsoft Implementation for Communities Wins Award

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

Power Platform World Tour

Find out where you can attend!

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