Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm trying to do something which I think should be pretty simple, but I'm having no luck figuring it out.
I have a table of test results from a calibration database.
Each device that is calibrated has multiple sensors. During calibration, some sensors are given multiple tests, my data looks like the first table on the left, shown below.
If any one of the tests on a sensor fails then the sensor is a fail, regardless of whether it passed the other tests. I've tried to capture this in the diagram above. The table on the right is an illustration, I don't have this table in my dataset.
I'm trying to create a measure that counts the number of fails and passes per sensor, as per the table on the right.
Does anyone know how this might be achieved? Thanks.
Solved! Go to Solution.
Hi @Anonymous
create the measures below,
Pass = COUNTX(FILTER('Table','Table'[Sensor Type]=MAX('Table'[Sensor Type]) && 'Table'[test_result]="PASS"),[test_result])
FAIL = COUNTX(FILTER('Table','Table'[Sensor Type]=MAX('Table'[Sensor Type]) && 'Table'[test_result]="FAIL"),[test_result])+0
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
create the measures below,
Pass = COUNTX(FILTER('Table','Table'[Sensor Type]=MAX('Table'[Sensor Type]) && 'Table'[test_result]="PASS"),[test_result])
FAIL = COUNTX(FILTER('Table','Table'[Sensor Type]=MAX('Table'[Sensor Type]) && 'Table'[test_result]="FAIL"),[test_result])+0
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Brilliant. Thank you.
Why is there a '+0' a the end of the FAIL measure?
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |