cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ikramelmbarki98
New Member

Conditional formatting of a subtotal that has the same value as total

Hello Power BI Community

 

I need you're help to format my matrix, so I have the value of total(B) that have the same value of the subtotal(B) and I need to format one of them to white so it'll not show me the same value twice.

 

I tried to create a measure to change the color based on a condition but It changes the colors of the two values total and subtotal (the two B)

MatriceCondictionalFormating.png

 

Any one can give me an idea to work on this issue 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @ikramelmbarki98 ;

You could create a column as new subcate.

Column = IF([Cate]=[Subcate],BLANK(),[Subcate])

Then create a measure.

Measure = 
IF(ISINSCOPE('Table'[Ssub]),SUM('Table'[value]),
IF(ISINSCOPE('Table'[Column])&&MAX('Table'[Column])=BLANK(),BLANK(),SUM('Table'[value])))

The final show:

vyalanwumsft_0-1668582601764.png


Best Regards,
Community Support Team _ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @ikramelmbarki98 ;

You could create a column as new subcate.

Column = IF([Cate]=[Subcate],BLANK(),[Subcate])

Then create a measure.

Measure = 
IF(ISINSCOPE('Table'[Ssub]),SUM('Table'[value]),
IF(ISINSCOPE('Table'[Column])&&MAX('Table'[Column])=BLANK(),BLANK(),SUM('Table'[value])))

The final show:

vyalanwumsft_0-1668582601764.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@ikramelmbarki98 , You can use isinscope or if needed the value and create a color measure and use that in conditional formatting using field value option

 

if(isinscope(Table[B]) , "Yellow", "White")

 

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

 

I tried it and it changes the color of the level 1 and 2 they consider it as a total

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors