Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello, PowerBI Guru
Based on raw data, I made one matrix which can tell the pass ratio for each component. The drill up to year and drill down to month can be supported. I would like to count the component which has test run and also which pass ratio > 95% for YEAR, or YEAR MONTH depends on drill up/down. For example, on 2020/01, 3 components have test run, and PassRatio of 2 > 95%, on 2020/02, 2 components tested and 1 component’s PassRatio > 95%. How can I create the measure ? The pbix is attached. Thanks in Advanced !
Here is raw data. Here is pbix link
Item ID | Component | Test Date | Pass/Fail |
P0001 | A | 20/01/2020 | Pass |
P0002 | A | 20/01/2020 | Pass |
P0003 | B | 20/01/2020 | Pass |
P0004 | C | 20/01/2020 | Fail |
P0005 | B | 20/01/2020 | Pass |
P0006 | A | 25/01/2020 | Pass |
P0007 | B | 25/01/2020 | Pass |
P0008 | C | 25/01/2020 | Pass |
P0009 | B | 25/01/2020 | Pass |
P0010 | C | 25/01/2020 | Pass |
P0011 | C | 25/01/2020 | Fail |
P0012 | A | 25/01/2020 | Pass |
P0013 | B | 15/02/2020 | Pass |
P0014 | B | 15/02/2020 | Pass |
P0015 | B | 15/02/2020 | Pass |
P0016 | B | 15/02/2020 | Pass |
P0017 | A | 15/02/2020 | Pass |
P0018 | B | 20/02/2020 | Pass |
P0019 | A | 20/02/2020 | Fail |
P0020 | B | 17/03/2020 | Pass |
P0021 | B | 17/03/2020 | Pass |
P0022 | B | 17/03/2020 | Pass |
P0023 | B | 17/03/2020 | Pass |
P0024 | B | 17/03/2020 | Pass |
P0025 | B | 17/03/2020 | Pass |
Solved! Go to Solution.
@pigip - I think % would be something like:
Count =
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
SELECTCOLUMNS(SUMMARIZE('Table',[Component]),"Comp",[Component])
"Pass",COUNTROWS('Table','Table'[Component] = [Comp] && 'Table'[Pass/Fail]="Pass"),
"Fail",COUNTROWS('Table','Table'[Component] = [Comp] && 'Table'[Pass/Fail]="Fail")
),
"Percent",[Pass] / ([Pass] + [Fail])
)
RETURN
COUNTROWS(FILTER(__Table,[Percent] >= .95))
@pigip - I think % would be something like:
Count =
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
SELECTCOLUMNS(SUMMARIZE('Table',[Component]),"Comp",[Component])
"Pass",COUNTROWS('Table','Table'[Component] = [Comp] && 'Table'[Pass/Fail]="Pass"),
"Fail",COUNTROWS('Table','Table'[Component] = [Comp] && 'Table'[Pass/Fail]="Fail")
),
"Percent",[Pass] / ([Pass] + [Fail])
)
RETURN
COUNTROWS(FILTER(__Table,[Percent] >= .95))
@pigip , Not very clear, This will give Ratio
divide(calculate(countrows(Table), filter(Table, Table[Pass/Fail] ="Pass")) ,calculate(countrows(Table)))