cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Huiyan
Regular Visitor

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?

Huiyan_0-1623996216963.png

Thanks in advance! 

Huiyan

1 ACCEPTED SOLUTION

@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 )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

View solution in original post

5 REPLIES 5
Fowmy
Super User IV
Super User IV

@Huiyan 

Can you paste the formula in this replay box as text to check?. 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

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,"")) 

@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?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

Huiyan
Regular Visitor

I'm creating a measure. You can see in the table below, there are only '150%' because I did the cap. For the empty cells, I want them to be filled with results of the underlined formula, e.g. 140%, 130%,80% etc. I need to revise the "" part. But I don't know how. @Fowmy 

 

Huiyan_0-1623997684704.png

 

@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 )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors