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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sitenfel
Regular Visitor

DAX Formula to Assign Date depending on quantity available

Hello Community,

 

First time poster but been lurking in the forum for a couple of years, I'm writing this post because I don't know how to frame this on a google search and also don't know where to start on this formula that iI have been tasked to create.

 

In the first table we have a table with two "orders" with quantity and an ETA on when they would be received.

 

On August 7th we will receive 2 pieces of SKU ABC and then 2 more pieces on August 10th

 

SKUQTYETA
ABC28/7/2021
ABC28/10/2021

 

I need a formula that could compute the ETA according to a set of rules:

 

1. Priority - Lower Number has higher priority

2. Order Date - Oldest Date has higher priority

 

In this we have two orders with priority 1, so they should get the first ETA of 08/07/2021, even though one of the orders has a later date than some of the orders, the priority takes presedence over the order date.

 

The second order of 2 pieces on 08/10/2021 should be considered and assign that date to the ETA column.

There are 3 orders pending with the same priority but only 2 pieces arriving,  the next rule is based on order date so, the orders with an order date of 07/04/2021 should receive the following 2 pieces incoming and the order from 07/08/2021 will need to wait until the next shipment but since there's no more shipments in the data it should have a No ETA or blank comment.

 

SKUPriorityOrder DateQTYETA
ABC17/4/202118/7/2021
ABC27/4/202118/10/2021
ABC27/4/202118/10/2021
ABC17/7/202118/7/2021
ABC27/8/20211No ETA

 

Hopefully the ask is clear, thank you very much for your assistance!
sitenfel



1 REPLY 1
lbendlin
Super User
Super User

@sitenfel Power BI is a reporting tool, not a  process management / material allocation tool.  You would probably also want an audit trail of your allocation decisions. Power BI has no memory and is thus not a suitable tool for this  (beyond some rudimentary forecasting).

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.