Forum Discussion

TcT85's avatar
TcT85
Icon for Helper III rankHelper III
3 years ago

Calculation between two tables based on other calculations

Hi,

 

Im trying to calculate the yield on component level by calculating like this:

 

Created Column

Filter Total NG Comp = NG Data[Serial Number] & " - " & NG Data[Component] & " - " & NG Data[Reference]

 

Created Measure

Component Yield =
VAR CompCount = COUNTROWS(GROUPBY(BOM list,BOM list[Component],BOM list[Reference]))
VAR TotalPCB = DISTINCTCOUNT(NG Data[Serial Number])
VAR Total Component= CompCount * TotalPCB
VAR Total NG Component = CALCULATE(DISTINCTCOUNT(NG Data[Filter Total NG Comp]),FILTER(NG Data,NG Data[Result]="NG"))
VAR Yield = 1 - Total NG Component / Total Component
Return Yield

 

But my first CompCount takes all the component for that product in the calculation instead of specific component.

What should I change ?

 

 

Relation ship is Bomlist.product - NGdata.product

BOM list    
ProductComponentReference  
AAAAA1  
AAAAA2  
ABBBB1  
ACCCC1  
     
     
NG Data    
Serial numberProductComponentReferenceResult
1111AAAAA1NG
1111ABBBB1NG
2222AAAAA1NG
3333ACCCC1NG

 

The result I'm looking for is yield for all components but here is a examlple for component AAA.

 

Total count of component AAA should be 6 components and the Yield for the component AAA should be 66,67% yield.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi TcT85,

     

    I couldn't find BOM list[Position] column/'NG Data'[Filter Total NG Comp] in your sample and I couldn't find “TotalPanels” in the "Total_Component" part.

     

    Please show me more details about your table and data model. You can share a sample file with me and show me a screenshot with the result you want. This will make it easier to find the solution.

     

    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.