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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Computing First in First Out (FIFO) Cost of Goods Sold (COGS) & Inventory Report

Does anyone have dax / SQL program to compute COGS (Cost of Goods Sold) & Inventory based on First in First Out (FIFO) method in Power BI Report

Below is the example

Would appreciate support on this.

 

Details available in DataQtyRate/QtyValueRemarks
Opening Stock1202240 
Purchase2003600 
     
Sales22051100 
     
Details to be Computed in Power BI   
Cost of Goods Sold (COGS):   
Opening Stock_Lot consumed1202240Consumption first from Opening Stock using FIFO (First in First Out)
Purchase_Lot consumed1003300Balance Consumption from Purchase lot using FIFO (First in First Out)
Total COGS2202.45540 
     
Closing Stock1003300Opening + purchase-COGS
4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , refer if this can help

 

https://radacad.com/dax-inventory-or-stock-valuation-using-fifo

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

https://radacad.com/dax-inventory-or-stock-valuation-using-fifo

This method is not useful for find cost. Data is coming incorrect

Anonymous
Not applicable

Hi Amit,

 

First of all thanks a lot for your reply. I checked out the link to solution. So the FIFO column that this solution refers is the gross margin (Sales value - cost arrived thru FIFO).

So can you tell me if I can also refelect 

a) The cost arrived thru FIFO

b) the inventory value at end of each day in this example

as I am attempting to have inventory dashboard with its value reflected. 

 

thanks

Anonymous
Not applicable

Hi @Anonymous ,

Please review the following links and check if they can help you achieve the requirements.

Share Valuation using FIFO method

Weighted Average Cost of Goods Sold

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with calculation logic of FIFO&COGS and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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