Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate Row and Total Percentage on Selection of Rows

Hi, 

 

I need to create a DAX measure that calculates the Picking % only for the columns with Comment Good

Picking % = 1 - ( Difference between Initial and Control / Control )

 

I have this example table: 

 InitialPrepControlCommentDiff Initial & ControlPicking %
 008Error?80%
 300Manquant3#DIV/0!
 002563Error25630%
 220Error?2#DIV/0!
 111Good0100%
 222Good0100%
 552Good3-0,5
TOTAL885 340%

 

What DAX measure should I write? 

 

Thank you 

Julie

3 REPLIES 3
Anonymous
Not applicable

HI @jewel_at ,

when I add your measure in a table I get correct row values.

But the total value is left blank or takes the sum. 
When I select some rows in my table (only the 'Good' ones) then the measure takes the sum of the Picking Accuracy (100% + 100% + 100% = 300%). Which is not the correct total (100% + 100% + 100% = should be 100%). 

You know how to get the total value?

Hi @Anonymous 

I updated my original response. The reason the total was left blank when there are other not "Good" comments is because, I assigned "" instead of 0. 

Are you looking for the average instead of Total Sum? You can use AVERAGEX instead 🙂

 

 

 

jewel_at
Resolver I
Resolver I

Hi @Anonymous 

 

Have you tried:

 

Picking % = 
var Comment = SELECTEDVALUE('Table'[Comments])
return IF (Comment = "Good", SUMX('Table', 1 - ('Table'[Diff Initial] - 'Table'[Control]/'Table'[Control])),0)

 

 

Hope that helps!

 

Jewel

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.