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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Dividing two calculated columns

Hello everyone,

Recently I started to work with powerBI, and my calculations are not working properly. This is my data;

KeyIDProcessStatus
A1AError
A2AError
A3A 

A4

ASuccess

B1

BError

B2

BSuccess

What I want to do is I want to create this table

ProcessNumber of ErrorNumber of Error&SuccessNumber of Error/Number of Error&Success
A2366,6%
B1250,0%

What I did is;

Number of Error: IF(table[Status]="Error", 1,0)

Number of Error&Status: (IF(table[Status]="Error" || table[Status]="Success", 1,0))
Number of Error/Number of Error&Status: 
(table[Number of Error])/sum(table[Number of Error&Status])

First two calculations are working properly. But third one, where I calculate the percentage, is not calculating correctly. How could I do this calculation?

Thank you so much

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

Column = CALCULATE( SUM([Error])/ SUM([Error & Success]), ALLEXCEPT('Table','Table'[Process]))

Eyelyn9_1-1642041960601.png

 

Or you could create measures instead:

Number of Error = COUNTROWS(FILTER('Table',[Status]="Error"))
Number of Error&Success = COUNTROWS(FILTER('Table',[Status] in {"Error","Success"}))
% = DIVIDE( [Number of Error],[Number of Error&Success])

Output:

Eyelyn9_0-1642041549205.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Please try:

Column = CALCULATE( SUM([Error])/ SUM([Error & Success]), ALLEXCEPT('Table','Table'[Process]))

Eyelyn9_1-1642041960601.png

 

Or you could create measures instead:

Number of Error = COUNTROWS(FILTER('Table',[Status]="Error"))
Number of Error&Success = COUNTROWS(FILTER('Table',[Status] in {"Error","Success"}))
% = DIVIDE( [Number of Error],[Number of Error&Success])

Output:

Eyelyn9_0-1642041549205.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Eyelyn,

First one somehow didn't work(Which I actually wanted to use column, instead of measure, cause I want to create group from column, which is not possible with measure). But the second one is working, thank you! 🙂 

Greg_Deckler
Community Champion
Community Champion

@Anonymous Shouldn't that last one be:

Number of Error/Number of Error&Status: sum(table[Number of Error]) / sum(table[Number of Error&Status])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Greg thank you for your reply but it is not working either..

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.

Top Solution Authors