'Production Yield Calculation in PowerBi

I am working on creating a production yield dashboard.

The dummy format of how my data looks is attached below. Image

I wanted to calculate yield of each operation individually. As you can see, a particular unit id can be present multiple times in a column, however, it is only present once in each operation.

Can you guys help me in filtering out yield with respect to Operation?

Yield basically is [(count of unique unit id in a particular operation that have a "pass" result) divided by (Count of total amount of unique unit id going into the operation)]



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source