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
shannondean84
New Member

Unleashed - Sales Over Time

Hello all. 

I've got Power BI setup to pull data from Unleashed, our inventory management and sales software. 
I've got almost everything working and reporting the way I need it to but the last bit is a metric to measure our sales.

I'm looking to create a measure that will display how many of each item (product code) has been sold in the previous 4 months.

Would anyone have any idea on how to write that formula that can then be applied to a stock-on-hand table as a new column?

Happy to provide any data needed, i'm just not sure where to begin.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shannondean84 , You need measure

 

[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])))


Opening

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



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

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

View solution in original post

2 REPLIES 2
shannondean84
New Member

Thank you! I'll give it a try.

amitchandak
Super User
Super User

@shannondean84 , You need measure

 

[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])))


Opening

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



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

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

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.