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
nattran
Helper I
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:

nattran_0-1595493899673.png

 

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:

 

nattran_1-1595494007016.png

 

Please can someone help?

 

thanks

 

2 ACCEPTED SOLUTIONS

@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:
LinkedIn

View solution in original post

v-eachen-msft
Community Support
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. 

1-1.PNG

 

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

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
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. 

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Pragati11
Super User
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


MVP logo


LinkedIn | Twitter | Blog YouTube 

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

Appreciate your Kudos!!

Proud to be a Super User!!

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 

@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:
LinkedIn

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.

Top Solution Authors
Top Kudoed Authors