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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using MAX in an IF statement

Hi all,

 

Im very new to this, this is my first post.

 

I am having some issues with an IF statement where I am trying to find the MAX value from 5 different columns, where the column is the MAX I want it to return different text. Most of the outputs from my new column  are correct but some of them are not and I cannot figure out why as it works on most?

 

Here is my formula.

 

1 Strategic Priority 2 = if('pbi_table'[Strategic Score]=0,"Not Assigned",
2 if(MAX(pbi_table[Closer Score],MAX(pbi_table[Growth Score],MAX(pbi_table[Proud Score],MAX(pbi_table[£ Score],MAX(pbi_table[Transform Score])))))=pbi_table[Closer Score],"Closer",
3 if(MAX(pbi_table[Closer Score],MAX(pbi_table[Growth Score],MAX(pbi_table[Proud Score],MAX(pbi_table[£ Score],MAX(pbi_table[Transform Score])))))=pbi_table[Growth Score],"Growth",
4 if(MAX(pbi_table[Closer Score],MAX(pbi_table[Growth Score],MAX(pbi_table[Proud Score],MAX(pbi_table[£ Score],MAX(pbi_table[Transform Score])))))=pbi_table[Proud Score],"Proud",
5 if(MAX(pbi_table[Closer Score],MAX(pbi_table[Growth Score],MAX(pbi_table[Proud Score],MAX(pbi_table[£ Score],MAX(pbi_table[Transform Score])))))=pbi_table[£ Score],"Cap",
6 if(MAX(pbi_table[Closer Score],MAX(pbi_table[Growth Score],MAX(pbi_table[Proud Score],MAX(pbi_table[£ Score],MAX(pbi_table[Transform Score])))))=pbi_table[Transform Score],"Transform",
7 "Investigate"))))))

 

Any help would be much appreciated.

2 REPLIES 2
vivran22
Community Champion
Community Champion

Hello

Welcome to the Power BI Community.

Is it possible to share the sample data along with the desired output? The requirement is not very clear from your current post.

Thanks!

Vivek
Anonymous
Not applicable

I cant see how to attach an excel file so I have added a sample in th etable below. Columns B-F are provided a score. Column G (Top Score) is a MAX calculation of Range B-F. Then Priority is an IF statement using MAX. It is very easy to do this in excel but I am trying to recreate this in power BI and I do not obtain the same results.

 

There is another slight issue in that on occassion the MAX number is matched between columns, then I need to figure out what to do in that scenario.

 

Title£ ScoreTrans ScoreCloser ScoreProud scoregrowth scoreTop scorePriority
115080015Top Score
2152000020Trans Score
300520020Proud Score
4201500020£ Score
5000000Not Assigned

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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