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

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