Forum Discussion

AllanBerces's avatar
AllanBerces
Icon for Post Prodigy rankPost Prodigy
6 months ago
Solved

IF morethan %100

Hi good day, can anyone help me on my measure. What i required is if the result is morethan 1 on my %completed then equal to 1 else %completed

 

%Completed_ =
    ([measure01]/[measure02])
  • hello AllanBerces 

     

    you can use if statement.

    here is an example. Divide21 is measure2 divided by measured1 which is over than 1.

    add if statement to define value over 1 then you can get divide21 becomes 1.

     

    Hope this will help.

    Thank you.

  • Hi,

     

    As per our  understanding, you’re attempted the calculating the percentage is greater than 1 (100%), it should return 1, otherwise it should return the actual %Completed value.

    You can update your measure like this:

    %Completed_ =
    MIN(
        DIVIDE([measure01], [measure02]),
        1
    )

    Explanation:

    • DIVIDE([measure01], [measure02]) safely performs the calculation and avoids division-by-zero errors.
    • MIN(value, 1) ensures the result never exceeds 1 (100%).
    • If the calculated percentage is greater than 1, the measure returns 1; otherwise, it returns the actual percentage.

    This will cap your completion percentage at 100%, which is commonly used in progress or completion metrics.

     

    Hope this helps

    Thanks!

4 Replies

  • hello AllanBerces 

     

    you can use if statement.

    here is an example. Divide21 is measure2 divided by measured1 which is over than 1.

    add if statement to define value over 1 then you can get divide21 becomes 1.

     

    Hope this will help.

    Thank you.

  • Hi,

     

    As per our  understanding, you’re attempted the calculating the percentage is greater than 1 (100%), it should return 1, otherwise it should return the actual %Completed value.

    You can update your measure like this:

    %Completed_ =
    MIN(
        DIVIDE([measure01], [measure02]),
        1
    )

    Explanation:

    • DIVIDE([measure01], [measure02]) safely performs the calculation and avoids division-by-zero errors.
    • MIN(value, 1) ensures the result never exceeds 1 (100%).
    • If the calculated percentage is greater than 1, the measure returns 1; otherwise, it returns the actual percentage.

    This will cap your completion percentage at 100%, which is commonly used in progress or completion metrics.

     

    Hope this helps

    Thanks!