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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors