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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CMSINFO
Frequent Visitor

Table Headers format

Hi all, I need to add a simple table with the information below...doesn't need to be linked to other vizualizations if not possible but I need the Headers with different colours in the background like below. Any suggestion? I have tried the table and matrix from PBI but can't format of conditional format the headers only.

 

Thresholds.JPG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi  @CMSINFO ,

 

As you refer you cannot setup conditional formatting to a column header however you can do two things:

  • Apply the same format of the column values to the header
  • Apply conditional formatting to the values and background of values

Based on this two things you can do a workaroud:

  • Your columns on the matrix needs to be converted to measures:
    • In my case I have 3 categories A, B, C that I want to have different colours
    • Create the following measures:
CAT A = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "A")

CAT B = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "B")

CAT C = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "C")

 

  • Place the measures in the columns of your matrix or table
  • Go to the options of the table/matrix Field Formatting
  • Choose each one of the measures and make the backgroung and letter the colour you want
    • In my example A = Green, B = Yellow, C = Red and letter for all of the white
    • For each one click the option Apply to header:

Formatting.png

 

  • Now add for each measure add conditional formatting for background and colour
    • In my example for all of them you have black text and white background
      • Be sure to choose diverging and both color the same

conditio.png

As you can see you have headers with different colours and the values of the tables are the same.

Cat-colour.png

 

You can also use the other conditional formatting options as color scale or field value just be sure to add one line for the "normal" values that are to be in black colour.

 

So although the Condittional formatting is not actually on the headers it looks like it is.

 

See attach PBIX file.

 

Regards,

MFelix

 

 


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

5 REPLIES 5
MFelix
Super User
Super User

Hi  @CMSINFO ,

 

As you refer you cannot setup conditional formatting to a column header however you can do two things:

  • Apply the same format of the column values to the header
  • Apply conditional formatting to the values and background of values

Based on this two things you can do a workaroud:

  • Your columns on the matrix needs to be converted to measures:
    • In my case I have 3 categories A, B, C that I want to have different colours
    • Create the following measures:
CAT A = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "A")

CAT B = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "B")

CAT C = CALCULATE(SUM(Table1[Value]);Table1[Cat] = "C")

 

  • Place the measures in the columns of your matrix or table
  • Go to the options of the table/matrix Field Formatting
  • Choose each one of the measures and make the backgroung and letter the colour you want
    • In my example A = Green, B = Yellow, C = Red and letter for all of the white
    • For each one click the option Apply to header:

Formatting.png

 

  • Now add for each measure add conditional formatting for background and colour
    • In my example for all of them you have black text and white background
      • Be sure to choose diverging and both color the same

conditio.png

As you can see you have headers with different colours and the values of the tables are the same.

Cat-colour.png

 

You can also use the other conditional formatting options as color scale or field value just be sure to add one line for the "normal" values that are to be in black colour.

 

So although the Condittional formatting is not actually on the headers it looks like it is.

 

See attach PBIX file.

 

Regards,

MFelix

 

 


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, This method is not possible for Matrix visual I guess.
Any alternative for Matrix ?

Thanks IN advance!

Hi @SUMESHKUMAR22

 

This is for the matrix visualization 


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 , 
Got it. But my requirement is almost similiar but in the column level I have 2 hirerachies. 
Is it possible to attain the color headers for the In-Program & Pre-Program ?

Pbix file link 

Screenshot 2024-01-06 164021.png
Thanks in advance!

Screenshot 2024-01-06 164021.pngHi @MFelix , 
Wanted to color the headers for the below highlighted at 2 column layers.

Thanks1

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.