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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.