cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Decomposition Conditional Formatting

Hi Team,
I have decomposition tree with 3 levels as shown below.
Requirement: In this hierarchy, I would need:
1. All 'Yes' nodes in Blue color
2. Level A node 'No' should be in Black
3. Level B node 'No' should be in Amber
4. Level C node 'No' should be in Grey

 

Sample pwbix file

https://1drv.ms/u/s!ArRkjWtfVLy-blFLsv39onMwWrQ

 

CF.png

1 ACCEPTED SOLUTION
Super User III
Super User III

Hi @BSM1985 ,

 

Try to add the following custom measure:

 

Measure = SWITCH(
                   TRUE();
                   SELECTEDVALUE(Testing[A]) = "NO";"Black";
                   SELECTEDVALUE(Testing[B]) = "NO";"#FFC200";
                   SELECTEDVALUE(Testing[C]) = "NO";"Grey"
                 )

 

 

You can also change the Black and Grey to other custom colour codes just remember to place the # before the code.

MFelix_0-1600690304608.png

 

Check PBIX file attach. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

4 REPLIES 4
Super User III
Super User III

Hi @BSM1985 ,

 

Try to add the following custom measure:

 

Measure = SWITCH(
                   TRUE();
                   SELECTEDVALUE(Testing[A]) = "NO";"Black";
                   SELECTEDVALUE(Testing[B]) = "NO";"#FFC200";
                   SELECTEDVALUE(Testing[C]) = "NO";"Grey"
                 )

 

 

You can also change the Black and Grey to other custom colour codes just remember to place the # before the code.

MFelix_0-1600690304608.png

 

Check PBIX file attach. 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Sorry @MFelix 

I was not clear. This works for one node, not for all as shown below. I would need different color for each 'No' for each node as shown in below screenshot.CF2.png

Hi @BSM1985 ,

 

Believe that has to do with the order of the function try:

Measure =
SWITCH (
    TRUE ();
    SELECTEDVALUE ( Testing[C] ) = "NO"; "Grey";
    SELECTEDVALUE ( Testing[C] ) = "Yes"; "Blue";
    SELECTEDVALUE ( Testing[B] ) = "NO"; "#FFC200";
    SELECTEDVALUE ( Testing[B] ) = "Yes"; "Blue";
    SELECTEDVALUE ( Testing[A] ) = "No"; "Black";
    SELECTEDVALUE ( Testing[A] ) = "Yes"; "Blue"
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Thanks a lot @MFelix 

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors