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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Anonymous
Not 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

View solution in original post

6 REPLIES 6
Anonymous
Not 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

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

 

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

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


amitchandak
Super User
Super 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-num...
https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values

 

isinscope

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.