cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I

## Highlight Max value in a matrix

Hi,

I've created a measure Avg Sales and below is the matrix I displayed the data:

Now Im trying to using the conditional formatting to highlight the max value per Department per Level. So the expected result is the following should be highlighted:

thanks

2 ACCEPTED SOLUTIONS
Solution Sage

@nattran, well it's DAX you're asking for.

Haven't really tested, but based on your image something like this should work:

maxSum =
VAR m =
CALCULATE (
MAXX ( SUMMARIZE ( 'table', 'table'[Dep] )CALCULATE ( SUM ( 'table'[Amt] ) ) ),
REMOVEFILTERS ( 'table'[Dep] )
)
VAR s =
SUM ( 'table'[Amt] )
RETURN
IF ( m s1 )

and then conditionally filter SUM('table'[Amt]) when maxSum = 1 then colour.

Feel free to connect with me:

Community Support

Hi @nattran ,

You could set the highlight in conditional formatting with a color measure( [Measure] is the value in matrix ).

``````FormatMeasure =
VAR a =
MAXX ( ALLEXCEPT ( 'Table', 'Table'[Column1] ), [Measure] )
RETURN
IF ( [Measure] = a, "yellow" )
``````

Here is my test result and test file for your reference.

If this post helps, then please consider Accept it as the solution to help the other members find it.
4 REPLIES 4
Community Support

Hi @nattran ,

You could set the highlight in conditional formatting with a color measure( [Measure] is the value in matrix ).

``````FormatMeasure =
VAR a =
MAXX ( ALLEXCEPT ( 'Table', 'Table'[Column1] ), [Measure] )
RETURN
IF ( [Measure] = a, "yellow" )
``````

Here is my test result and test file for your reference.

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

Hi @nattran ,

There is an existing tread for this issue:

https://community.powerbi.com/t5/Desktop/highlight-specific-rows-in-matrix/m-p/893600

Thanks,

Pragati

Best Regards,

Pragati Jain

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

Proud to be a Super User!!

Helper I

Thanks. But in this case, I need to find dynamic MAX sales value per department per level based on the time period selection. How can I achieve that?

thanks

Solution Sage

@nattran, well it's DAX you're asking for.

Haven't really tested, but based on your image something like this should work:

maxSum =
VAR m =
CALCULATE (
MAXX ( SUMMARIZE ( 'table', 'table'[Dep] )CALCULATE ( SUM ( 'table'[Amt] ) ) ),
REMOVEFILTERS ( 'table'[Dep] )
)
VAR s =
SUM ( 'table'[Amt] )
RETURN
IF ( m s1 )

and then conditionally filter SUM('table'[Amt]) when maxSum = 1 then colour.

Feel free to connect with me:

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors