Forum Discussion

Huiyan's avatar
Huiyan
Regular Visitor
5 years ago
Solved

Multiple IF and return calculated results if false

Hey Guys, 

 

Can you kindly guide me on the formula below? If formula result is bigger than 1.5, i want to cap it at 1.5, otherwise I need to keep the calculated result. Is there a way to do this?

Thanks in advance! 

Huiyan

  • Huiyan 

    Can you try this formula?

    Achievement_viz =
    VAR one =
        CALCULATE (
            IF (
                [Culmulative] = 0,
                SUM ( Data[A2020] ) / SUM ( Data[M2020] ),
                (
                    ( SUM ( Data[A2020] ) - SUM ( Data[Baseline] ) )
                        / ( SUM ( Data[M2020] ) - SUM ( Data[Baseline] ) )
                )
            )
        )
    RETURN
        IF ( one >= 1.5, 1.5, one )
    

5 Replies

    • Huiyan's avatar
      Huiyan
      Regular Visitor

      Fowmy  Millions thanks!

      Achievement_viz = CALCULATE(IF((IF([Culmulative]="0",SUM(Data[A2020])/sum(Data[M2020]),((SUM(Data[A2020])-sum(Data[Baseline]))/(SUM(Data[M2020])-SUM(Data[Baseline])))))>1.5,1.5,"")) 
      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        Huiyan 

        Can you explain where you are getting the wrong results, you can share the screenshot that includes all the fields. Are you creating a Measure or a Calculated column?