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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jmdaily83
Helper II
Helper II

Max value by different categories in column and showing project number that matches that value

I have a table like the below

jmdaily83_0-1717602403307.png

 

And I would like the end result to show as below with the corresponding project name listed for the max value of that attribute.   When I do it in a table visual and use Max on the value it shows properly, but when I add the project number it shows all of the projects and not the corresponding project to the max value. 

 

jmdaily83_1-1717602606997.png

 

Intended Power 

 

1 ACCEPTED SOLUTION

Hi,

These measures work

M = max(Data[Max])
Measure = CALCULATE(MIN(Data[Project Number]),FILTER(VALUES(Data[Max]),Data[Max]=max(Data[Max])))

Hope this helps.

Ashish_Mathur_0-1717716869855.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
jmdaily83
Helper II
Helper II

@Anonymous ; @Ashish_Mathur ; @rajendraongole1 

Thank you all for helping.  However I have tried those calculations and they're not working. I will try to explain the issue I'm running into better.

 

Below I have the attributes and the Max value for that attribute.  There is only 1 row for each attribute which is correct and this filters properly based on related project information in another table. For example, the max Internal Engineering value is $281,295.

jmdaily83_0-1717686509262.png

 

However, the client also wants the project listed that is associated with that max amount. When I add the project number it now shows the max for the attribute & each project.  I only want the project showing that is associated to the $281,295 value. I can't do this is the table by calculated column since I need it to be dynamic and based on filters.

jmdaily83_1-1717686634315.png

 

 

Here is some of the data - hopefully it can be copy/pasted easily

AttributeMaxProject Number
Intended Power (MW)18010049100
Intended Power (MW)5010056000
Intended Power (MW)410064800
Intended Power (MW)10Pharr and Crosby BESS
Intended Energy (MWh)18010049100
Intended Energy (MWh)5010056000
Intended Energy (MWh)410064800
Intended Energy (MWh)10Pharr and Crosby BESS
System Time (hours)110049100
System Time (hours)110056000
System Time (hours)110064800
System Time (hours)1Pharr and Crosby BESS
Internal Engineering $236199.810049100
Internal Engineering $27919010056000
Internal Engineering $28129510064800
External Engineering $811379.910049100
kWh DC BOL24281610049100
kWh DC BOL7602410056000
kWh DC BOL736010064800
kWh DC BOL13416Pharr and Crosby BESS
Engineering3.6510049100
Engineering3.63358910056000
Engineering38.2194310064800
Engineering11.03882Pharr and Crosby BESS

 

 

 

 

 

 

 

Hi,

These measures work

M = max(Data[Max])
Measure = CALCULATE(MIN(Data[Project Number]),FILTER(VALUES(Data[Max]),Data[Max]=max(Data[Max])))

Hope this helps.

Ashish_Mathur_0-1717716869855.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This worked! Thank you so much

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @jmdaily83 ,

I create a table as you mentioned.

vyilongmsft_0-1717638745932.png

Then I create a measure and here is the DAX code.

MaxProject = 
CALCULATE ( MAX ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Project] ) )

vyilongmsft_1-1717638878963.png

I think you can use a Slicer and a card.

vyilongmsft_2-1717638959349.png

 

 

 

Best Regards

Yilong Zhou

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

rajendraongole1
Super User
Super User

Hi @jmdaily83 - Project name alongside the maximum value for each attribute.I have created a calculated column 

 

Create a new calculated column:

 

MaxValuePerProject =
VAR MaxValue = CALCULATE(MAX('Table'[Value]), ALLEXCEPT('Table', 'Table'[Attribute]))
RETURN
    IF('Table'[Value] = MaxValue, 'Table'[BD Opportunity], BLANK())
 
Snap:
rajendraongole1_0-1717608108648.png

 

 

Snap2

rajendraongole1_1-1717608154620.png

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@rajendraongole1 Thank you - that works if I don't filter the table down but there are other project variables (in a related table) that will be sliced on and the results should be dynamic. I should have explained this in my initial post.  For example. If the project is in California it would show the max values by attribute and the project with that max value.

 

Thank you for your help

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.