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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors