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

Calculate performance percentage based on 4 conditions

Hello everyone, would really appreciate your help!

 

I am struggling to get the right KPI becasue of a few conditions things resulting in infinite numbers.

 

Many thanks in advance )

 

Order QtyDefect QtyPerformance%  (Defect Qty / Order Qty)
55 
103 
00 
250 

 

Conditions:

1. If Order Qty = Defect Qty then Performance = 0%

2. If  Order Qty >1 and Defect Qty = 0 then Performance = 100%

3. If Order Qty = 0 and Defect Qty = 0 then Performance = 0% (This is what gives the infinite numbers)

4. For any other case outside of first 3 conditions simply use the Performance Calculation = Defect Qty / Order Qty 

 

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

try this column

Performance Calculation = 
VAR __defect =  'Table'[Defect Qty] 
VAR __order = 'Table'[Order Qty]
RETURN 
SWITCH(
    TRUE,
    __defect = __order, 0,
    __defect = 0 && __order > 1, 1,
    DIVIDE( __defect, __order )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

try this column

Performance Calculation = 
VAR __defect =  'Table'[Defect Qty] 
VAR __order = 'Table'[Order Qty]
RETURN 
SWITCH(
    TRUE,
    __defect = __order, 0,
    __defect = 0 && __order > 1, 1,
    DIVIDE( __defect, __order )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Anonymous
Not applicable

Hi Mariusz,

 

Thank you for your time & solution!

 

 

 

Hi @Anonymous 

 

No problem 🙂

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

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
Top Kudoed Authors