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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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