Forum Discussion
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
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.
Check PBIX file attach.
10 Replies
- MFelixSuper User
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.
Check PBIX file attach.
- MFelixSuper User
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" )
- AnonymousNot applicable
Hi MFelix,
Can you please share how the color of the parent data bars can also be changed as per a condition?
- eli9879Regular Visitor
I would like to display on my decomposition tree the "Names" columns with the colors in the "Color" columns respectively.
How can I do that?
I tried with a measure like Switch(True(),Selectvalue(Name1),color) but it doesn't work for me.- MFelixSuper User
Hi eli9879 ,
Not sure if I understand what you mean by "Names" columns with the colors in the "Color" columns respectively.
Try to create the following measure:
Color Coding = SWITCH(TRUE(), ISINSCOPE('Table'[Name3]), SELECTEDVALUE('Table'[Color3]), ISINSCOPE('Table'[Name2]), SELECTEDVALUE('Table'[Color2]), ISINSCOPE('Table'[Name1]), SELECTEDVALUE('Table'[Color1]))Be carefull with the order of the columns since the switch function stops at the first result:
See file attach.
- eli9879Regular Visitor
Amazing!! very helpful.
Thanks