Forum Discussion
Machine Capacity Planning
- Anonymous3 years ago
Hi TimmK ,
I suggest you to sort your order by Date and Duration. We will prioritize completing the orders which are near the deadline or the shorter duration ones.
Sort Order by Date and Duration = VAR _ADD1 = ADDCOLUMNS ( FILTER ( 'Table', 'Table'[Duration] <= 960 ), "Rank", VAR _RANK1 = RANKX ( 'Table', 'Table'[Duration],, ASC, DENSE ) VAR _RANK2 = RANKX ( 'Table', 'Table'[Date],, ASC, DENSE ) RETURN _RANK2 * 100 + _RANK1 ) VAR _ADD2 = ADDCOLUMNS ( _ADD1, "NewRank", RANKX ( _ADD1, [Rank],, ASC, DENSE ) ) RETURN SUMX ( FILTER ( _ADD2, [Order Key] = EARLIER ( 'Table'[Order Key] ) ), [NewRank] )Result is as below. Blank one means that duration is out of machine support.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi TimmK ,
I suggest you to sort your order by Date and Duration. We will prioritize completing the orders which are near the deadline or the shorter duration ones.
Sort Order by Date and Duration =
VAR _ADD1 =
ADDCOLUMNS (
FILTER ( 'Table', 'Table'[Duration] <= 960 ),
"Rank",
VAR _RANK1 =
RANKX ( 'Table', 'Table'[Duration],, ASC, DENSE )
VAR _RANK2 =
RANKX ( 'Table', 'Table'[Date],, ASC, DENSE )
RETURN
_RANK2 * 100 + _RANK1
)
VAR _ADD2 =
ADDCOLUMNS ( _ADD1, "NewRank", RANKX ( _ADD1, [Rank],, ASC, DENSE ) )
RETURN
SUMX (
FILTER ( _ADD2, [Order Key] = EARLIER ( 'Table'[Order Key] ) ),
[NewRank]
)
Result is as below. Blank one means that duration is out of machine support.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.