Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Production Yield Calculation

Hello all,

I am working on creating a production yield dashboard. Dummy format of how my data looks is attached below. 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)]

RDVT_0-1643132280563.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

Measure =
VAR Count_UnitID =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] ),
            'Table'[Status] = "pass"
        )
    )
VAR Count_ALL =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] )
    )
RETURN
    DIVIDE ( Count_UnitID, Count_ALL )

Icey_1-1643356093741.png

 

 

Column =
VAR Count_UnitID =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] ),
            'Table'[Status] = "pass"
        )
    )
VAR Count_ALL =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] )
    )
RETURN
    DIVIDE ( Count_UnitID, Count_ALL )

Icey_0-1643356042648.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check:

Measure =
VAR Count_UnitID =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] ),
            'Table'[Status] = "pass"
        )
    )
VAR Count_ALL =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] )
    )
RETURN
    DIVIDE ( Count_UnitID, Count_ALL )

Icey_1-1643356093741.png

 

 

Column =
VAR Count_UnitID =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] ),
            'Table'[Status] = "pass"
        )
    )
VAR Count_ALL =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Unit ID] ),
        ALLEXCEPT ( 'Table', 'Table'[Cycle], 'Table'[Operation] )
    )
RETURN
    DIVIDE ( Count_UnitID, Count_ALL )

Icey_0-1643356042648.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@Anonymous Perhaps:

Measure =
  VAR __Denominator = COUNTROWS('Table')
  VAR __Numerator = COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER('Table',[Status]="pass"),"Unit ID",[Unit ID])))
RETURN
  DIVIDE(__Numerator,__Denominator,0)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 
Thank you for the reply. I did try using this method and I see 100% yield for all the processes whiich is not the case. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.