Forum Discussion
hummingbird
Helper II
2 years agoFault Percentage per Order
Hey, I've got two tables that are interconnected by Order ID. Table 1 contains all order information and Table 2 has 3 columns: Order ID, Fault Type and Fault Percentage. There can be multipl...
- 2 years ago
hummingbird
Add the order number from Table1 to a table visual and the following measure:Fault Measure = VAR __SumFault = SUM('Table2'[Fault Percentage]) VAR __Result = SWITCH( TRUE(), __SumFault <= 0.4 , "Green", __SumFault > 0.4 && __SumFault <= 0.5 , "Amber", "Red" ) RETURN __Result
Fowmy
Super User
2 years agohummingbird
Your Table1 has one product in your example per order, what if there are multiple products per order, then your relationship will break. if you have one-to-many.
More details required for your second question.
hummingbird
Helper II
2 years agoThanks. Let's assume there is only one product per order ID and we just need to know the sum of faults from the second table.
- Fowmy2 years ago
Super User
hummingbird
Add the order number from Table1 to a table visual and the following measure:Fault Measure = VAR __SumFault = SUM('Table2'[Fault Percentage]) VAR __Result = SWITCH( TRUE(), __SumFault <= 0.4 , "Green", __SumFault > 0.4 && __SumFault <= 0.5 , "Amber", "Red" ) RETURN __Result