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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TcT85
Helper III
Helper III

Need help to Calculate the FPY Based on 2 columns with Pass and Fail

Hi,

From the data table, I need to calculate the first pass yield based on Serial Number.

One serial number has many Result, but I'am only intrested if the serial number has a defect but i want to know the procentage.

In this case I wan't the result to show 50% FPY since serialnumber 2222222 has a defect and serialnumber 44444444 has 0 defects.

How should i write the DAX formulation?

 

Serial numberReferencePin nrVolumeResult
2222222C1156Defect
2222222C1255Defect
2222222C31103GooD
2222222C32104GooD
2222222C51105False Call
2222222C52106GooD
2222222C71107False Call
2222222C72108GooD
2222222C9130Defect
2222222C920Defect
4444444C11103GooD
4444444C12103GooD
4444444C31103GooD
4444444C32104GooD
4444444C51105GooD
4444444C52106GooD
4444444C71107GooD
4444444C72108GooD
4444444C91108GooD
4444444C92108GooD
1 ACCEPTED SOLUTION

Hi @TcT85 ,

 

Thanks for your reply and clarification.

How about this:

tomfox_0-1645122941470.png

 

Here comes the measure:

TomsFPYMeasure = 
VAR _helpTable =
SUMMARIZE ( 
    'Table',
    'Table'[Serialnumber],
    "SerialNumberCount", DISTINCTCOUNT ( 'Table'[Serialnumber] ),
    "DefectYesNo", IF ( CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Result] = "Defect" ) > 0, 0, 1 )
)
RETURN
DIVIDE ( SUMX ( _helpTable, [DefectYesNo] ) ,SUMX ( _helpTable, [SerialNumberCount] ) )

 

Does this work for you? 🙂

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

7 REPLIES 7
tackytechtom
Super User
Super User

Hi @TcT85 ,

 

Could you provide the data and maybe an outcome exactly of what you would like to achieve?

I feel like I would only be guessing right now 🙂

Thanks!

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi Tom,

 

Sorry for lack of information.

I would like to recieve the Firstpass yield based on a formula with Serialnumber and Result.

 

Total FPY for all products
50%

 

and

 

ProductFPY
A50%
B100%
C0%

 

Here is the set of data:

ProductSerialnumberReferencePin NrVolumeResult
A1111C1156Defect
A1111C1255Defect
A1111C21103Good
A1111C22104Good
A2222C11105Good
A2222C12106Good
A2222C21107Good
A2222C22108Good
B3333C11102Good
B3333C12103Good
B3333C21101Good
B3333C22102Good
C4444C1130Defect
C4444C120Defect
C4444C21103Good
C4444C22102Good

 

But with your formula I get this result.

TcT85_0-1645087604836.png

 

The product C need to show 0% and product B need to show 100%

Hi @TcT85 ,

 

Thanks for your reply and clarification.

How about this:

tomfox_0-1645122941470.png

 

Here comes the measure:

TomsFPYMeasure = 
VAR _helpTable =
SUMMARIZE ( 
    'Table',
    'Table'[Serialnumber],
    "SerialNumberCount", DISTINCTCOUNT ( 'Table'[Serialnumber] ),
    "DefectYesNo", IF ( CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Result] = "Defect" ) > 0, 0, 1 )
)
RETURN
DIVIDE ( SUMX ( _helpTable, [DefectYesNo] ) ,SUMX ( _helpTable, [SerialNumberCount] ) )

 

Does this work for you? 🙂

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom

 

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi Tomfox,

 

This is working perfectly, I got excatly what I was looking for. 😀

 

But can you please explain the red marked area, how this works?

Just in case i would copy this formula for some other cases.

 

TcT85_1-1645182134145.png

I appreciate your time, patience and expertize, big thanks! 😀

 

Hi @TcT85 ,

 

Awesome that I could help you! 🙂

 

The marked part meets the statements of the if clause: The logical test condition, the result to be returned if the logical test is TRUE (in our case: 0) and the result to be returned if the logical test is FALSE (in our case: 1)

 

The logical test checks whether there is a "defect" row for each serial number. If there is one, then we return 0, otherwise 1. This is how the helpTable looks like:

tomfox_0-1645210784367.png

 

Later, we could just use these columns to divide over the sum of DefectYesNo by the sum of SerialNumberCount .

 

Have a great day! 🙂

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

tackytechtom
Super User
Super User

Hi @TcT85 ,

 

You can try this and let me know whether it works for you:

tomfox_0-1644614106839.png

TomsFPYMeasure = 
VAR _helpTable =
SUMMARIZE ( 
    Table,
    Table[Serial number],
    "SerialNumberCount", DISTINCTCOUNT ( Table[Serial number] ),
    "DefectYesNo", CALCULATE ( COUNTROWS ( Table ), Table[Result] = "Defect" ) 
)
RETURN
DIVIDE ( COUNTX ( _helpTable, [DefectYesNo] ), SUMX ( _helpTable, [SerialNumberCount] ) )

 

/Tom

https://www.tackytech.blog

https://www.instagram.com/tackytechtom



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Hi Tom,

 

Thanks for the formula, i got out 50% that I wanted.

But i encountered another issue with this formula when i added som more data.

Product C , i want that product to show 0% FPY instead of 100%.

TcT85_2-1644842609602.png

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.