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
dswinden
Helper I
Helper I

Starting & Ending Inventory Columns

Hello,  

 

Struggling with what feels like a very simple function.  My data looks like the below table example.  Essentially i need to create a starting inventory column and an ending inventory column.  Where;

 

Starting Inventory = Ending Inventory of Previous Week + New inventory

Ending Inventory = Starting Inventory of Current Week less Sales for that week

 

dswinden_1-1685464402311.png

 

 

1 ACCEPTED SOLUTION
dswinden
Helper I
Helper I
5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.  Ensure there is a Calendar table with a Week starting column.


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

Hi,

Share the download link of the PBI file.  Ensure there is a Calendar table with a Week starting column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
dswinden
Helper I
Helper I
amitchandak
Super User
Super User

@dswinden , You have to use a cumulative approach

 

Inventory / OnHand
[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))

Inventory / OnHand
CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))

 

Power BI Inventory On Hand
Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw

Hi @amitchandak as always, appreciate you are usually one of the first to reply!

WOuld you mind editing that DAX for the fields in my table above?  Thank you!

 

 

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.