cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Horizontal Conditional Formatting in Matrix Visual

Hello, 

i need to apply conditional formatting in matrix visual in powerBI (top 3 value in each rows).

I Tried top n in dax but it did not worked for me . 

ex- below snapshot for refrence

Dhrutivyasa070_0-1676983933488.png

Thanks in advance.

Dhruti

 

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Here's a measure expression that shows one way to do it. Just use this measure as the Field for conditional formatting for the measure in the matrix visual. Note that if you have a sort-by column on your month, you'll need to include that in the measure too.

 

ppm1_0-1676984755345.png

 

Top3MonthColor =
VAR thismonth =
    MIN ( 'Date'[Month] )
VAR top3Mos =
    TOPN ( 3, ALLSELECTED ( 'Date'[Month] ), [Total Qty], DESC )
RETURN
    IF ( thismonth IN top3Mos, "Light Green" )

Pat

Microsoft Employee

View solution in original post

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Here's a measure expression that shows one way to do it. Just use this measure as the Field for conditional formatting for the measure in the matrix visual. Note that if you have a sort-by column on your month, you'll need to include that in the measure too.

 

ppm1_0-1676984755345.png

 

Top3MonthColor =
VAR thismonth =
    MIN ( 'Date'[Month] )
VAR top3Mos =
    TOPN ( 3, ALLSELECTED ( 'Date'[Month] ), [Total Qty], DESC )
RETURN
    IF ( thismonth IN top3Mos, "Light Green" )

Pat

Microsoft Employee

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

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!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors