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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
TimmK
Helper IV
Helper IV

Machine Capacity Planning

I have four machines, each with a capacity of 960 minutes. At any given time, only one job can be processed in a machine. The jobs often have varying processing times in the machine.

 

The table "SL" provides all the necessary information. It has columns "Date", "Order Key", and "Duration". "Date" is the binding delivery date, "Order Key" is the order number, and "Duration" is the processing time required for each order.

 

I now want a Power BI DAX Measure that calculates the ideal machine allocation for me, so that as many orders as possible are processed by the deadline (i.e., by the delivery date).

 

Is this possible within Power BI? If yes, how?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

vrzhoumsft_0-1692690230539.png

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.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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.

vrzhoumsft_0-1692690230539.png

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.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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