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

How to get the MAX of a measure in DAX?

I have a measure called [Staff Performance] which is simply DIVIDE([Measure A], [Measure B])

 

On a matrix visual, this [Staff Performance] measure displays correctly = at daily and weekly levels.

The matrix has a drill-down hierarchy of Manager -> Staff -> Week -> Day. When the data displays at Manager level, I would like the a measure that will be the MAX([Staff Performance]) across all of the staff under the manager. 

But when I try this measure

 

Best Staff Performance := MAX([Staff Performance])

 

I receive an error: The MAX function only accepts a column reference as an argument.

How can I write a measure to do this?

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

You can use this approach with MAXX().  This should give you the max employee for each Manager, and the overall MAXX in the "Total".

 

Max Employee Value = MAXX(VALUES(Table[Employee]), [Staff Performance])

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

something like this

Best Staff Performance = calculate(MAX([Staff Performance]), allexpect(Table[Manager]))

 

in case you need to build hierarchy using the path , refer -https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies

mahoneypat
Employee
Employee

You can use this approach with MAXX().  This should give you the max employee for each Manager, and the overall MAXX in the "Total".

 

Max Employee Value = MAXX(VALUES(Table[Employee]), [Staff Performance])

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.