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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

bucle for power query o dax

Hello

This is the example for a day

I want to create a blucle for with variables of the same date, thickness, and width.

Take into account the maximum number of days and make a conditional difference in stock and outputs.

MarcDeu_0-1678274032482.png

date - width - thickness

11/07/2022 - 4,95 -276 the maximum is 24

14 in stock and 6 outputs --> FIFO is met

11/07/2022 - 4,95 -276 days are 23

33 in stock and 3 outputs --> FIFO is not met (because the previous one is still in stock)

date - width - thickness

07/11/2022 - 11 -250 the maximum is 42

2 in stock and 2 outputs --> FIFO is fulfilled

07/11/2022 - 11 -250 the maximum becomes 34 (there are no more in stock of those days)

3 in stock and 3 outputs --> FIFO is fulfilled

07/11/2022 - 11 -250 the maximum becomes 27 ((there are no more in stock of those days)

4 in stock and 1 outputs --> FIFO is fulfilled

This is possible with power query or dax, I can't find a way to do it

Thank you

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

It is not well what I was trying to do but it has helped me to solve it.

Thank you

amitchandak
Super User
Super User

@Syndicate_Admin , Are you looking for FIFO

 

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors