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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table of vehicles that have regular inspections. The same vehicle will appear in the table more than once. Sometimes that vehicle will pass an inspection and soemtimes it will fail. I need to calculate the percentage of inspections that result in a pass. It seems like this should be easy but the measure I'm using always returns 100% when I drag the vehicle ID in. The % is correct when I use a basic card that aggregates across the entire table.
The (rough) DAX I'm using at the moment:
VAR numberOfInspections = COUNTX('inspections', 'inspections'[_index])
Solved! Go to Solution.
Hi,
Try these measures:
Row count = COUNTROWS(Data)Pass count = CALCULATE([Row count],Data[pass]=TRUE())Pass % = DIVIDE([Pass count],[Row count])
Hope this helps.
Hope this satisfies your requirement, if yes, kindly mark the answer as correct so that it can help others as well
This should work >>>
Step 1
The below is an anonymised example. I'd expect to see 50% returned for each vehicle with these values.
| vehicle | pass |
| vehicle 1 | TRUE |
| vehicle 2 | FALSE |
| vehicle 3 | TRUE |
| vehicle 1 | FALSE |
| vehicle 2 | TRUE |
| vehicle 3 | FALSE |
Hi,
Try these measures:
Row count = COUNTROWS(Data)Pass count = CALCULATE([Row count],Data[pass]=TRUE())Pass % = DIVIDE([Pass count],[Row count])
Hope this helps.
Many thanks
You are welcome.
Use ALL so that it can come out of the Row Context there .....
Use this DAX = VAR numberOfInspections = COUNTX(ALL('inspections'), 'inspections'[_index])
Regards,
Ritesh
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users
Thanks for the input. Unfortunately it hasn't solved the situation
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |