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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
balmin2304
New Member

Nested If

Hi,

I have a table as below in Excel.  However, in Power BI, how do I put a measure to calculate the rate and score based on the achieved figures. This is the if command I used in Excel to get the score. "=IF(M2<=0.65,1,IF(AND(M2>0.65,M2<0.95),2,IF(AND(M2>=0.95,M2<=1),3,IF(AND(M2>1,M2<1.15),4,IF(M2>=1.15,5)))))", where M2 is referred to as Achieved. And for each row, I changed the syntax according to the rating scale. Can I have one measure to include all these in one?

Achieved    Rate        Score

66%21.00
66%20.10
75%30.15
2.620.10
11%40.08
21%20.14
33%20.04
3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @balmin2304 ,

 

Based on your descriptions, I have changed the IF to measure:

Measure = SWITCH(TRUE(),

MAX('Table'[Achieved])<=0.65,1,

MAX('Table'[Achieved])>0.65&&MAX('Table'[Achieved])<0.95,2,

MAX('Table'[Achieved])>=0.95&&MAX('Table'[Achieved])<=1,3,

MAX('Table'[Achieved])>1&&MAX('Table'[Achieved])<1.5,4,5)

Output:

vjianbolimsft_0-1658928346979.png

The measure works fine, but the result seems to be different with the Score and Rate, could you please share more details about how to calculate them to help us clarify your scenario?

Please provide me with more details about your data and your problem or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for your reply and sorry for the delay in responding to you.  The measure works fine, but my issue is that I have different targets for different items as shown in the table below.  What I need to find is the Score based on the achieved against the rating scale mentioned for each.

 

 

KpisKpI WtTargetRt-1Rt-2Rt-3Rt-4Rt-5AchievedScore
Abdcd 100%As per approved budget≤65%>65%-<95%≥95%-≤100%>100%-<115%≥115%98%3
nbnbnbn100%80%≤65%>65%-<78%≥78%-≤82%>82%-<90%≥90%84%4
mnmnmn100%75%<60%≥60%-<75%≥75%-≤78%>78%-<86%≥86%79%4
kjkjkjk70%3.5≤2.5>2.5 -<3.3≥3.3 -≤3.7>3.7 - <4.0≥4.03.84
SpartaBI
Community Champion
Community Champion

@balmin2304 not sure I understand. You can PM me to do a quick zoom if you want

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon & SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.