Forum Discussion
Hierarchy based text conditional formatting
Hi Power Bi Experts,
I want to display the grand total text values into red, Region total into blue & Mine total black. As this is hierarchy in rows. How we can do it based conditional formatting.
- Anonymous5 years ago
Hi prakash11440278 ,
Sorry to disturb you...
But did I answer your question ? Please mark my reply as solution. Thank you very much.Best Regards,
Stephen Tao
6 Replies
- amitchandakSuper User
prakash11440278 , You have to create a color measure with isinscope and use that in conditional formating with field value option
https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-valuesisinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
- mahoneypatMicrosoft Employee
You could use a measure expression like this in the text conditional format to do that. Replace table with your actual table name.
Text Color = IF(ISFILTERED(Table[Mine]), "Black", IF(ISFILTERED(Table[Region]), "Blue", "Red")
Regards,
Pat
- MFelixSuper User
Hi prakash11440278 .
you need to create a measure similar to this one:
Formatting = SWITCH( TRUE(); ISINSCOPE('Table (2)'[Mine]);"black"; ISINSCOPE('Table (2)'[Region]); "blue"; "Red" )Be aware that the order of the parameters is important for the final resutl
- prakash11440278Post Prodigy
Hi MFelix mahoneypat amitchandak ,
Thanks for your reply.
I have replicated in my report it is working fine except the total part, which the font colors are not coming as expected.
- AnonymousNot applicable
Hi prakash11440278 ,
Based on my test, you could set the colors of Grant total and Subtotals separately. In Subtotals, they can no longer be divided.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi prakash11440278 ,
Sorry to disturb you...
But did I answer your question ? Please mark my reply as solution. Thank you very much.Best Regards,
Stephen Tao