The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have two tables, and I need to find the yield for each type.
The tables are fictional, the real table contains over 25 different names in the Type Column.
I only know how to use with including with filters.
Defect table | |||
Product | Serialnr | Part | Type |
A | 0001 | Corn | Defect |
A | 0001 | Corn | Warning |
A | 0002 | Carrot | Warning |
A | 0002 | Corn | Defect |
A | 0002 | Corn | Defect |
A | 0002 | Corn | Scratch |
A | 0003 | Carrot | Defect |
A | 0004 | Cabbage | Defect |
A | 0004 | Cabbage | Warning |
B | 0006 | Carrot | Defect |
B | 0007 | Corn | Warning |
B | 0008 | Carrot | Warning |
B | 0009 | Corn | Defect |
B | 0010 | Carrot | Defect |
B | 0011 | Carrot | Defect |
Produced Table | ||||
Product | Quantity | Defect | Warning | Scratch |
A | 4 | 4 | 3 | 1 |
B | 6 | 4 | 2 | 0 |
This is the result I want.
Yield Table | |
Product | Yield |
A | 0% |
B | 33% |
Solved! Go to Solution.
Hi @TcT85
I included blank value in my table and now I get the following result
To fix that, I have to add the modify my formula with:
Hi @TcT85,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @bhanu_gautam, @mdaatifraza5556, @Cookistador for the prompt response.
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the super user's resolved your issue?
If our super user's response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @TcT85,
We wanted to kindly follow up to check if the solution provided by the super user's resolved your issue?
If our super user's response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @bhanu_gautam , @mdaatifraza5556 and @mdaatifraza5556
Thanks for the quick response all of your solution works, but I have an issue that even blank cells from Type column are included in the calculation.
Can anyone of you help me with a dax formula that also exclude the blanks?
Hi @TcT85
Include one more filtering part in the filter.
'Defect table'[Type] <> blank()
If this answers your questions, kindly accept it as a solution.
Hi @TcT85
I included blank value in my table and now I get the following result
To fix that, I have to add the modify my formula with:
@TcT85 , Try this
Proud to be a Super User! |
|
Hi @TcT85
Please follow the below steps
1. Create measures using below DAX.
Hi @TcT85
The following measure will return the right result
@TcT85 , Create two measures
DAX
DistinctCountExcludingWarning =
CALCULATE(
DISTINCTCOUNT('Defect table'[Serialnr]),
'Defect table'[Type] <> "Warning"
)
Yield =
1 - DIVIDE(
[DistinctCountExcludingWarning],
SUM('Produced Table'[Quantity])
)
Proud to be a Super User! |
|