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
pardeepd84
Helper III
Helper III

IF STATEMENT BASED ON MAX VALUE

Hello,

 

I have created a measure which I thought calculated the max  from a caculated column however when I have written the measure and added it into a matrix or table under values I have the option to change the value to sum, average, min, max etc.  Once I have changed it to max, by results appear correct though.  

 

I need to sum the values in two of the column (My MAX - only when the value is set to MAX though) and sum it with Emp ID in the table visual but it doesn't return the expected results. 

 

My max meaure is:

 

MY MAX = CALCULATE(MAX('table'[Same Visit]),
ALLEXCEPT('table', 'table'[Company Name], 'table'[customer ID], 'table'[Emp ID]))
 
Note = The column - same visit is a calculated column. 
 
What I need to do it count the 'my max'column with the emp id and if over 10 return "good" else "requires improvement".
 
Unfortuantely due to data protection I can't sgare the file/data but this is a screesnshot of the table visual:
 
pardeepd84_0-1619822961708.png

The two columns (results and if over 10 are what I am trying to acheive).

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@pardeepd84 

"My Max" is a calculated column and you have set the calculation to MAX . If you can share a sample file then it would be great.


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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@pardeepd84 

"My Max" is a calculated column and you have set the calculation to MAX . If you can share a sample file then it would be great.


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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi @ Fowmy,

 

unfortunately due to data protection I am unable to share the data. 

 

I have created a measure to get the max based on a calculated and then used the ALL EXCEPT filter however although I have used the MAX function when I add it to a table visual it doesn't show the max, instead I have the option to get the average, min,max,standard deviation etc. Once I select MAX though and it gives me the results I require. From this calculation I now need to sum the rows for 2 columns when the values for "My Max" has been set to MAX.

 

I have managed to resolve this myself, no further assistance required for this query. 

@pardeepd84 

Gald you managed to solve it.  Happy to assist you in any future issues/questions.


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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.