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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have manufacturing data coming in that says whether a part is good, bad, or some category in between. The data is item by item, so I'm trying to count the values. What I can't seem to do is calculate a simple yield of x good/x total per week. I can use the ALL () to get everything that I'm looking at, but that doesn't help. I've tried ALL, ALLSELECTED, CALCULATE, FILTER, banging head against wall, etc.
example of data is:
| Week number | ID number | Condition |
| 31 | 1 | Good |
| 31 | 2 | Bad |
| 32 | 3 | Bad |
| 32 | 4 | Good |
| 32 | 5 | Good, except A |
What I expect is:
Week 31 = 50% (1 good, 2 total)
Week 32 = 33% (1 good, 3 total)
And in a visual, I should be able to graph (line) the data by week and see it go from 50% to 33%, and then add in the "good, except A" value and see week 32 go to 67%.
Searching seems to get be close, but not there. So I'm hoping someone can help.
Solved! Go to Solution.
Try these measures:
My Count of Good = CALCULATE ( COUNTROWS(MyTable), [Condition] = "Good" )
Total Rows = COUNTROWS(MyTable)
Percent Good = DIVIDE( [My Count of Good], [Total Rows], 0 )
All those measures will respect the weekly slice when you plot.
Proud to be a Super User! | |
Thank you, that helped. I've been spending a lot of time on the power query side, and am just now getting used to the DAX side. Specifically getting used to measures.
Try these measures:
My Count of Good = CALCULATE ( COUNTROWS(MyTable), [Condition] = "Good" )
Total Rows = COUNTROWS(MyTable)
Percent Good = DIVIDE( [My Count of Good], [Total Rows], 0 )
All those measures will respect the weekly slice when you plot.
Proud to be a Super User! | |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!