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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Zvekanm
Frequent Visitor

Running total

Hi ,

 

 

 

i have small issue with running total. 

Im calculating stock value in warehause from 2022 till today, and its working.

For quantities vorking with no mistake, but for value not.

Problem with value calculation is pricing changed on the begining 2023.

All part on stock has new price at 01.01.2023

 

To explain.

On 31.12.2022 a i have on stock 1 PCE with value 10Eur

 in January 2023 is consuption 1 PCE with new value 11Eur and my value stock is now-1 EUR

 

How to solve this issue?

 

6 REPLIES 6
Zvekanm
Frequent Visitor

hi,

 

running total

Stock Value EUR =
VAR _result=
CALCULATE(
   [Starting Value]+[Total Value 101]+[Total Value 102]-[Total Value 122]+[Total Value 123]-[Total Value 261]+[Total Value 262]-[Total Value 711]+[Total Value 712]-[Total Value 291]+[Total Value 309]-[Total Value 601]+[Total value 602],
    FILTER(ALLSELECTED('DIM Calendar'[Transaction_Date]),
    'DIM Calendar'[Transaction_Date]<=MAX('DIM Calendar'[Transaction_Date])
    )
    )/117.5
    return _result
 
one of the meassure
Total Value 101 =
CALCULATE(
SUM('MSEG Material MvM'[Loc.curr.amount]),
filter('MSEG Material MvM','MSEG Material MvM'[MvT]=101)
)
 
depends of type of movement (101,102...)its adding or subtracts on stock value
Value is from extract table in SAP
Zvekanm_0-1691998967907.png

 

 

hmm looks complicated try 

CALCULATE(
   [Starting Value]+[Total Value 101]+[Total Value 102]-[Total Value 122]+[Total Value 123]-[Total Value 261]+[Total Value 262]-[Total Value 711]+[Total Value 712]-[Total Value 291]+[Total Value 309]-[Total Value 601]+[Total value 602],
    'DIM Calendar'[Transaction_Date]<=MAX('DIM Calendar'[Transaction_Date]
    )
    )/117.5

@eliasayyy 

 

if you have more simple solution... then you are my best friend 😄

problem is that i must track stock value on weekly base of each material.

then material group... procurment type.. supplier..

lot of demands from my manager.

this is only solution that work for me.

plus i need every type of movement in other calculation..

well i cant help out much without seeing datasets but if you just want to get the stock vlue per week , powerbi automatically does that 
your measure above will sum up all values until today example if yesterday i had 10$ and today i had 30$ the measure will return 
10 on yesterday and 40 on today if you just want to return the price per day just use a simple max function 

and top of that...

Forecast..

addind each PO to stock for forecasting stock value in next period - consuption 

😄

easy task for me

eliasayyy
Memorable Member
Memorable Member

please provide with more information please. share measures , your pbix or a sample dataset explaining what you want

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.