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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
emilvladu
Frequent Visitor

Calculate percentage of target achieved when target is a negative number

Hello everyone,

 

I have to report what is the achievement vs target but I have a problem when the targets or actual are negative.
There are eight scenarios as you can see below.

Is there any specific formula to sum up all this scenarios?

 

 Target.jpg

Thanks,

2 ACCEPTED SOLUTIONS

If the formula not consistent, there will be no way to program it.  Can you build up a series of IF/THEN statements to describe how each formula is created?

View solution in original post

@emilvladu

 

I'm not quite sure about your rule. I create a calculated column based on your sample data (a lot of nested IFs).

 

Actual Vs Target =
IF (
    'Table'[Actual] / 'Table'[Target]
        > 0,
    IF (
        'Table'[Actual] > 0
            && 'Table'[Target] > 0,
        'Table'[Actual] / 'Table'[Target],
        IF (
            'Table'[Actual] > 'Table'[Target],
            'Table'[Actual] / 'Table'[Target]
                + 1,
            - ( 'Table'[Actual] / 'Table'[Target] )
        )
    ),
    IF (
        'Table'[Actual] < 'Table'[Target],
        'Table'[Actual] / 'Table'[Target]
            - 1,
        1
            - 'Table'[Actual] / 'Table'[Target]
    )
)

66.PNG

 

 

Regards,

View solution in original post

6 REPLIES 6
dedelman_clng
Community Champion
Community Champion

What is your Excel calcuation for "Real Actual vs Target" ?

Please find bellow

 

New Bitmap Image.jpg

@emilvladu

 

I'm not quite sure about your rule. I create a calculated column based on your sample data (a lot of nested IFs).

 

Actual Vs Target =
IF (
    'Table'[Actual] / 'Table'[Target]
        > 0,
    IF (
        'Table'[Actual] > 0
            && 'Table'[Target] > 0,
        'Table'[Actual] / 'Table'[Target],
        IF (
            'Table'[Actual] > 'Table'[Target],
            'Table'[Actual] / 'Table'[Target]
                + 1,
            - ( 'Table'[Actual] / 'Table'[Target] )
        )
    ),
    IF (
        'Table'[Actual] < 'Table'[Target],
        'Table'[Actual] / 'Table'[Target]
            - 1,
        1
            - 'Table'[Actual] / 'Table'[Target]
    )
)

66.PNG

 

 

Regards,

Anonymous
Not applicable

Hi, thanks for the nested ifs formula, 

I tried it myself and it works! but just a point on one of the formula (in red), 

I had to change it to (Actual-Target)/ABS(Target) + 1. 

it works for the example of Actual = -5 and Target = -10, 

However, it won't work when Actual = -8 and Target = -10. your formula will give 180% instead of 120% . 

 

Actual Vs Target =
IF (
    'Table'[Actual] / 'Table'[Target]
        > 0,
    IF (
        'Table'[Actual] > 0
            && 'Table'[Target] > 0,
        'Table'[Actual] / 'Table'[Target],
        IF (
            'Table'[Actual] > 'Table'[Target],
            'Table'[Actual] / 'Table'[Target]
                + 1,
            - ( 'Table'[Actual] / 'Table'[Target] )
        )
    ),
    IF (
        'Table'[Actual] < 'Table'[Target],
        'Table'[Actual] / 'Table'[Target]
            - 1,
        1
            - 'Table'[Actual] / 'Table'[Target]
    )
)

 

It works, Simon!

Thanks.

If the formula not consistent, there will be no way to program it.  Can you build up a series of IF/THEN statements to describe how each formula is created?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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