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

Background color for a row table/matrix

Hi,

 

I would like to add a background color for a row. Conditional formatting only works for columns.

 

I would like to add a color for the whole GLOBAL row only. Please help

It should look like this (global row all one color)It should look like this (global row all one color)I'm using alternating rows but not what I wantI'm using alternating rows but not what I want

 

 

1 ACCEPTED SOLUTION
MariaP
Solution Supplier
Solution Supplier

Hi @Anonymous ,

 

You can create a measure and use the new 'Conditional Formating' option where you select formatting by

'Field Value' and in this you choose the measure shown below.

You do this for every column.

 

COLOUR GLOBAL PROJECT ROW = 

IF  (HASONEVALUE(Projects[Project])
    ,IF( FIRSTNONBLANK('Projects'[Project] , 0) = "GLOBAL"
        ,"lightgreen"
        ,"white"
    )
    ,BLANK()
)

Conditional Formatting- Select the measure here.Conditional Formatting- Select the measure here.Apply to every column, works for matrix and tableApply to every column, works for matrix and table

SAMPLE PBIX

 

Maria

View solution in original post

5 REPLIES 5
MariaP
Solution Supplier
Solution Supplier

Hi @Anonymous ,

 

You can create a measure and use the new 'Conditional Formating' option where you select formatting by

'Field Value' and in this you choose the measure shown below.

You do this for every column.

 

COLOUR GLOBAL PROJECT ROW = 

IF  (HASONEVALUE(Projects[Project])
    ,IF( FIRSTNONBLANK('Projects'[Project] , 0) = "GLOBAL"
        ,"lightgreen"
        ,"white"
    )
    ,BLANK()
)

Conditional Formatting- Select the measure here.Conditional Formatting- Select the measure here.Apply to every column, works for matrix and tableApply to every column, works for matrix and table

SAMPLE PBIX

 

Maria

zendu
Microsoft Employee
Microsoft Employee

This is not really a solution. It is a workaround. It is overhead to copy this for every column in long run of the report.

Hi @MariaP 

I was wondering if its possible to change the color for the "ROWS" using a matrix chart. I mean your code works 100% if i use a table, but if i use Matriz, does not work.

I have this:

Noredlac86_0-1676322787035.png

 

and i want to change the color of the rows (I mean the text in the first column, A) 0-15Days.... etc.

Im using matrix chart. I need that the first row, will be total green, the second one total yellow and go on, but your code just works for values.

Do you know if there is any workaround.?

Did you find any soloutions to this?

Anonymous
Not applicable

 

UPDATE:  I have found the answer on another thread here: https://community.powerbi.com/t5/Desktop/Apply-a-color-based-on-year-differentiate-each-year-with/m-...


Hi Maria,  this really helped me too.  I was wondering if it is possible to add another DAX formula in to colour a different row another colour.  

for example in the example presented above, if I wanted to also colour the 'APAC' row in yellow?  Is this possible at all please?  

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors