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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
pxlated
New Member

Running Inventory Total DAX

Hey folks. I have a client with a tricky scenario that I'm stuck on. My transactional tables are filtered via RLS. I am working on creating a matrix visual such that we are looking at a static inventory number and then calculating a rolling inventory for the current month and future months based on having transactional data associated to open orders and monthly sales forecasts. I am having an issue getting this rolling inventory measure to work, and I've been stuck on this for weeks:

 

# Starting Inventory = CALCULATE(DISTINCTCOUNT('transactional table1'[column1]), 'transactional table'[Source]="Inventory", ALL(DIM_Date))

 

# Sold = CALCULATE(DISTINCTCOUNT('transactional table1'[column1]), 'transactional table 1'[Source]="Retail")

 

# Sold (sum total) = CALCULATE([# Sold],ALLSELECTED('transactional table1'))

 

# ASF = SUM('transactional table 2'[column1])

 

% modifier = DIVIDE([# sold], [# sold (sum total)], 0)

 

# Monthly Sales Forecast = ROUND([% modifier]*[# ASF], 0)

 

# Monthly Inventory Changes = IF([# Sold]>[# Monthly Sales Forecast], [# Sold], [# Sold]+[# Open Orders]-[# Monthly Sales Forecast])

 

# Rolling Inventory = [# Starting Inventory] + [# Monthly Inventory Changes]

 

The problem I'm running into is that no matter how I try to create say a running total of [# Monthly Inventory Changes] and then add that to the [# Starting Inventory] such that my [# Rolling Inventory] actually iterates, I'm getting vastly odd numbers for my [# Monthly Inventory Changes - (cumulative] attempts.

 

Latest attempt at cumulative sum for inventory chages: 

# Monthly Inventory Changes (Sum) =
CALCULATE (
[# Monthly Inventory Changes],
FILTER ( ALL ( DIM_Date[Date] ), DIM_Date[Date] <= MAX ( DIM_Date[Date] ) )
)

 

pxlated_0-1711142005621.png

 

I have a feeling the problem that I'm running into is how i'm trying to use a centralized date table for a running total, but that shouldn't be the case since both transactional tables that are referenced in the monthly inventory changes measure should take this into account just fine. any help here would be apprecaited.

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.