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
mboucher_rcr
Frequent Visitor

Monthly Inventory Value

Hi,

 

I have data with weekly inventory values per product and store. What I need to get to is the below 2 measures:

1. Average Total Inventory by Product per Month

2. Last/Latest Total Inventory by Product per Month

 

Sample source data:

DateItemStoreSOH
7/02/2022A1Melbourne50
7/02/2022A1Sydney90
14/02/2022A1Melbourne60
14/02/2022A1Sydney100
21/02/2022A1Melbourne40
21/02/2022A1Sydney120
28/02/2022A1Melbourne55
28/02/2022A1Sydney80
7/03/2022A1Melbourne20
7/03/2022A1Sydney70
14/03/2022A1Melbourne10
14/03/2022A1Sydney80
21/03/2022A1Melbourne5
21/03/2022A1Sydney100
28/03/2022A1Melbourne50
28/03/2022A1Sydney80
4/04/2022A1Melbourne40
4/04/2022A1Sydney90
7/02/2022B2Melbourne10
7/02/2022B2Sydney500
14/02/2022B2Melbourne10
14/02/2022B2Sydney400
21/02/2022B2Melbourne5
21/02/2022B2Sydney410
28/02/2022B2Melbourne0
28/02/2022B2Sydney350
7/03/2022B2Melbourne50
7/03/2022B2Sydney500
14/03/2022B2Melbourne45
14/03/2022B2Sydney450
21/03/2022B2Melbourne40
21/03/2022B2Sydney100
28/03/2022B2Melbourne35
28/03/2022B2Sydney150
4/04/2022B2Melbourne50
4/04/2022B2Sydney150

 

Required Results:

 

Average Total Inventory by Product per Month

 FebruaryMarchApril
A174.37551.87565
B2195.83171.25100

 

Last/Latest Total Inventory by Product per Month

 FebruaryMarchApril
A1135130130
B2350185200

 

Hoping someone can point me in the right direction to achieve this! Thanks 😁

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

Hi Ashish,

Im having similiar requirement, can you send me the pbix file, couldnt download the file from onedrive as it got deleted

Regards
Anand

Hi,

I do not have the files.  Share some data, explain the question and show the expected result.


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

i have d 365 inventtranstable where it has item out & item in transactions:- 
sample table:-

DATEFINANCIALCATEGORYinventory value
01-01-2024 00:00pepsi-10364.27
02-01-2024 00:00coke500000000
03-01-2024 00:00fanta-69323.41
04-01-2024 00:00thumsup-64566.39
05-01-2024 00:00pepsi0
06-01-2024 00:00maaza566666
07-01-2024 00:00pepsi-79063.53

Expected result in powerbi matrix visualization:-

CATEGORYJanfebmar
pepsi500001000002000000
coke400006000150002
maaza70000820100700100
sprite900009201001000100
thumsup50000820100900100

need to create measure to retrive those monthly snapshot values from daily transactions at the end of month or 1st day of next month( anything is fine).

im getting correct values using this sql query but having trouble to replicate the logic in sql/powerbi:- SELECT SUM(InventoryValue) from MONTHLYINVENTORYVALUE
WHERE CATEGORY= 'pepsi'
AND DATEFINANCIAL <='2024-02-01';

I do not see any link between the input and output tables.  Based on the input table, show the expected result.


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

Thanks Ashish. The Last Total Inventory calculation is working well but the Average Total Inventory is not working with my actual data, I'm getting very low figures which don't add up.

You are welcome.  I cannot say why my formulas are not working with your data.  From the file that i have shared with you, my calculations work fine and tally with the your expected result.  How can i help you further?


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

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.