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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Jorjor
Frequent Visitor

Making the top level of a matrix red if any of the lower levels is negative

I have a matrix with item, item group and qty. I would like to make a conditional formatting that says that when a single item in the group is negative make the whole group red. Is this possible? Does it need dax?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jorjor ,

 

@Ritaf1983 , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution: 

 

Based on your description, I created these data.

vkaiyuemsft_0-1719215457195.png


1. create MEASURE and find the value that is negative.

Test =
IF(
MAX('Table'[Value])<0,1,0)

 

2. create MEASURE, find the group with negative numbers and set it to red.

colour =
var _max=
MAXX(
FILTER(ALL('Table'),'Table'[Group1]=MAX('Table'[Group1])),[Test])
RETURN
IF(
_max=1, "red")

 

3. Create a conditional format. You can set where it is applied according to your needs.

vkaiyuemsft_1-1719215505204.png

 

vkaiyuemsft_2-1719215505205.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Jorjor ,

 

@Ritaf1983 , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement and implemented the result. Please check if there is anything that can be improved. Here is my solution: 

 

Based on your description, I created these data.

vkaiyuemsft_0-1719215457195.png


1. create MEASURE and find the value that is negative.

Test =
IF(
MAX('Table'[Value])<0,1,0)

 

2. create MEASURE, find the group with negative numbers and set it to red.

colour =
var _max=
MAXX(
FILTER(ALL('Table'),'Table'[Group1]=MAX('Table'[Group1])),[Test])
RETURN
IF(
_max=1, "red")

 

3. Create a conditional format. You can set where it is applied according to your needs.

vkaiyuemsft_1-1719215505204.png

 

vkaiyuemsft_2-1719215505205.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

Ritaf1983
Super User
Super User

Hi @Jorjor 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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