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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
v-jeevanay
Microsoft Employee
Microsoft Employee

Conditional Formatting in Matrix Visual

Hi Folks,

 

I have an interesting scenarios in Power BI Matrix visual. First look at the following final output image.

vjeevanay_1-1738648573378.png

In rows section i have 3 fields TimeZone, Area, and Segmen. In values secton i have some metric.

The ask here is i need to highlight the top 3 and bottom 3 values irrespective of the drill down.

 

For example, in the above image first TimeZone "Americas" expanded upto Segment level and the other two TimeZones are not expanded upto Segment level. Now the conditional formatting ask is even though below two are not expanded to Segement i still need to consider whatever value is visible in the entire value column and highlight the top 3 and bottom 3.

 

In the image above bottom 3 values are as follows:
US - EC MFG (Segment level)  = 88%

ANZ - Enterprise (Area Level) = 76%

Western Europe - Enterprise (Area Level) = 88%

 

Top 3 Values are as follows:
Switzerland - Enterprise (Area Level) = 115%

US - HPSI HLS (Segment Level) = 104%

US - EC RCG (Segment Level) = 104%

 

 

is there any way we can do this kind of conditional formatting for the visible level values (one is expanded others are not) in matrix visual in Power BI.

@amitchandak @Ritaf1983 @Greg_Deckler @v-yiruan-msft @Idrissshatila @danextian @rajendraongole1

1 REPLY 1
amitchandak
Super User
Super User

@v-jeevanay ,

Create two measure like

top =

Rank(dense, Allselected(Table, Table[Zone], Table[Area], Table[Segment]),Orderby([Your Measure], desc),partitionBy(Table[Zone]) )

 

 

Bottom = Rank(dense, Allselected(Table, Table[Zone], Table[Area], Table[Segment]),Orderby([Your Measure], asc),partitionBy(Table[Zone]) )

 

 

Now using thise you can create another meausre when you have create coloe and use them in conditional formatting using field value option

 

Color = Switch(true() ,

[Top] =1 || [Bottom]=1, "Green",

// Other coditions

)

 

You can also use rownumber if needed

 

Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo

Rownumber- https://www.youtube.com/watch?v=yS9-IQjUDwg&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=1

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.