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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors