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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
prakash11440278
Post Prodigy
Post Prodigy

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.

 

prakash11440278_1-1609850662466.png

 

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

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

View solution in original post

6 REPLIES 6
v-stephen-msft
Community Support
Community Support

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

MFelix
Super User
Super 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


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



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.

 

prakash11440278_0-1609916918016.png

 

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.

20.png21.png

 

 

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.

mahoneypat
Employee
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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.