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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
mabCOLONEL
Frequent Visitor

Trying to conditionally format per heirarchy level.

I have the matrix table as shown.  I wanted to conditionally format the highest to lowest number per column based on the hierarchy level only.  Currently, when I apply the conditional formatting, it will base the color on the entire column value.  I am not great with measures as of yet, so this is a learning process.  I know the screen shot is a poor example, but assume the values in the far right column are not always the same.  So I would like to format the levels independantly of each other where noted group 1 will format independantly of group 2.  

Thank you in advance. Screenshot 2022-11-07 163450.png

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @mabCOLONEL ,

 

This is my test table:

vyadongfmsft_0-1667875433490.png

 

If you want to conditionally format the minimum value of different types of item in each group separately,

vyadongfmsft_1-1667875573309.png

please create a new column as below shown:

 

Min_value of item = SWITCH(
    TRUE(),
    'Table'[Value] = MINX(FILTER('Table','Table'[Group] = EARLIER('Table'[Group]) && 'Table'[Type] = "Type1"),'Table'[Value]),"red",
    'Table'[Value] = MINX(FILTER('Table','Table'[Group] = EARLIER('Table'[Group]) && 'Table'[Type] = "Type2"),'Table'[Value]),"yellow")

 

vyadongfmsft_0-1667884875613.png

 

 

 

Conditional formatting for value:

vyadongfmsft_0-1667876804460.png

 

You will get a matrix visual like this which format the levels independantly:

vyadongfmsft_1-1667876896904.png

Best regards,

Yadong Fang

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

Thank you but I dont have just type 1 and type 2.  I have hundreds of items at that hierarchy level.  So a measure per 'type 1' vs 'type 2' is not going to be an effective solution.  Those 'types' can change names as well. 

amitchandak
Super User
Super User

@mabCOLONEL , You can use isinscope and and create a color measure and use that in conditional formatting using field value option

 

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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