DAX aggregation help

jake32008

New Member
Joined
Apr 10, 2015
Messages
27
I am trying to calculate production capacity and have the following inputs:

Product Group - overall capacity is limited by the bottleneck process
Process
Machine
Product Type - some processes have machines have varying capacity depending on product type
Production Shift

[TABLE="class: grid, width: 406, align: left"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]GROUPING[/TD]
[TD]CALCULATION[/TD]
[TD]EXAMPLE[/TD]
[TD]QUANTITY[/TD]
[/TR]
[TR]
[TD]PRODUCT GROUP[/TD]
[TD]MIN[/TD]
[TD]PRODUCT GROUP A[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD]PROCESS[/TD]
[TD]SUM[/TD]
[TD]PROCESS 1[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD]MACHINE[/TD]
[TD]MIN[/TD]
[TD]Machine 1[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD](blank)[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD](blank)[/TD]
[TD="align: right"]300[/TD]
[/TR]
[TR]
[TD]PROCESS[/TD]
[TD]SUM[/TD]
[TD]PROCESS 2[/TD]
[TD="align: right"]450[/TD]
[/TR]
[TR]
[TD]MACHINE[/TD]
[TD]MIN[/TD]
[TD]Machine 1[/TD]
[TD="align: right"]175[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD](blank)[/TD]
[TD="align: right"]175[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]First[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]Second[/TD]
[TD="align: right"]75[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]Third[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]MACHINE[/TD]
[TD]MIN[/TD]
[TD]Machine 2[/TD]
[TD="align: right"]275[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD](blank)[/TD]
[TD="align: right"]275[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]First[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]Second[/TD]
[TD="align: right"]50[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD]Third[/TD]
[TD="align: right"]125[/TD]
[/TR]
[TR]
[TD]PROCESS[/TD]
[TD]SUM[/TD]
[TD]PROCESS 3[/TD]
[TD="align: right"]500[/TD]
[/TR]
[TR]
[TD]MACHINE[/TD]
[TD]MIN[/TD]
[TD]MACHINE 1[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD]Type A[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD](blank)[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD]MACHINE[/TD]
[TD]MIN[/TD]
[TD]MACHINE 2[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD]Type A[/TD]
[TD="align: right"]350[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD](blank)[/TD]
[TD="align: right"]350[/TD]
[/TR]
[TR]
[TD]PRODUCT TYPE[/TD]
[TD]SUM[/TD]
[TD]Type B[/TD]
[TD="align: right"]250[/TD]
[/TR]
[TR]
[TD]PRODUCTION SHIFT[/TD]
[TD] [/TD]
[TD](blank)[/TD]
[TD="align: right"]250[/TD]
[/TR]
</tbody>[/TABLE]




















































I have tried using the following formula which aggregated correctly at the machine level but not at the product group level:

production capacity:=SWITCH(TRUE(),
HASONEVALUE(production_capacity[product group]), MIN(production_capacity[capacity]),
HASONEVALUE(production_capacity[process]), SUM(production_capacity[capacity]),
HASONEVALUE(production_capacity[machine]), MIN(production_capacity[capacity]),
HASONEVALUE(production_capacity[product_type]), SUM(production_capacity[capacity]),
SUM(production_capacity[capacity]))

What am I missing here? Thank you in advance for any help.

Jake
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top