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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
carH
Helper I
Helper I

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
v-xicai
Community Support
Community Support

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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