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
Anonymous
Not applicable

FIFO stock management

Hello, everyone! Hope you all are doing ok. 🙂
So I'm new to Power BI and DAX and I was hoping someone can help me with this issue.
Imagine that I have a market that sells oranges. I would like to manage the stock according to a FIFO process.
So, first I sell all the oranges I have in stock until I run out of it, then I make a purchase and make all the sells until I reach 0 again.
I made an example table with data that can make you better understand my problem.
MicrosoftTeams-image.png

On the example, I associated an index to each buy and sell so you can understand better the goal. I need to accomplish this on a Power BI report.
Note that, even though we have dates of when the sells and the buys occur, we still need to organize the data according to FIFO.
MicrosoftTeams-image (1).png

Thanks in advance for anyone who tries to help me.

2 REPLIES 2
amitchandak
Super User
Super User

Anonymous
Not applicable

I saw that blog already and that is not the flow I need my stock to take. The goal in this specific case is to have an initial stock and make all the sells you can until you run out of stock, then you put in the first "Buy" so that you have stock for the next sales. In other words, the goal is at one point reaching an empty stock, as you can see in my table "Expected Results".

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.