I have a complex issue of calculating the costs of Parent to Child Orders.
The following image shows the Parent to Child table.
The next image shows the Order Costs table, here we show the order number, operation number and cost for each operation.
Next I show an image of the costs associated to each order, however the costs returned are for the maximum operation number associated to each order.
What I need to do is show the total costs for each Parent Order & associated rework orders (or child orders), similar to the image below.
I used the following calculated column in the Parent to Child table to concatenate all orders per row.
HierarchyColumns =
VAR OrderNumber =
[Original_ProdOrder_Number] & "-" &
[Rework Order-1] & "-" &
[Rework Order-2] & "-" &
[Rework Order-3] & "-" &
[Rework Order-4] & "-" &
[Rework Order-5]
VAR LastNonDashPosition =
MAXX (
GENERATESERIES (1, LEN(OrderNumber)),
IF (
MID (OrderNumber, [Value], 1) <> "-",
[Value],
BLANK()
)
)
RETURN
LEFT (OrderNumber, LastNonDashPosition)
So I was hoping to create a DAX measure using the HierarchyColumn to determine the total costs for each Parent and associated Child order, by getting the Maximum Op No costs for each Parent & Child association.
Any help would be appreciated.
JR
BI and Excel file attached.
Parent to Child Costs.pbix (31.2 KB)
Parent to Rework Orders.xlsx (12.0 KB)