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

Conditional Formatting in Matrix Ignores Blank Cells

Hey there!

 

As stated in the title, I am trying to color cells in a matrix but the blank cells are ignoring the conditional formatting.

 

I have the following dummy data for my project assignment table:

id_personpersonweekNumber
1Person A1
1Person A2
1Person A2
1Person A3
1Person A3
1Person A4
1Person A4
2Person B2
2Person B2
2Person B4
2Person B4
2Person B4
2Person B5
2Person B8
2Person B8
2Person B8
2Person B9
2Person B9
3Person C2
3Person C3
3Person C3
3Person C5
3Person C6
3Person C8
3Person C9

 

Then I created two measures:

 

 

_countingMeasure = COUNT(assignment[id_person])
_colorWeekSix = IF(MAX(assignment[WeekNumber]) = 6, "Red", "Yellow")

 

 

 

I put this data in a matrix and would like to color the column of a specific week like this (the yellow is only for testing and would be white in the final product.):

MuffinMouse_0-1638448015084.png

However, it only shows me this:

MuffinMouse_1-1638448052450.png

 

For testing purposes I have also tried to specifically color the blank cells red with the following measure, but it only colors the non-blanks:

 

 

_colorBackgroundAllBlanks = IF(ISBLANK([_countingMeasure]), "Red", "Yellow")

 

 

MuffinMouse_2-1638448222043.png

 

In many of the answered threads the solution was to set the "is blank" rule in the Conditional Formatting Wizard (see screenshot below), but I don't think I can use it here. For the testing example it works, but the goal isn't to only color the blanks.

Additionally, my conditions for the colors are dependent on multiple measures in my orignal project, so there is not just a single field I could base it on.

MuffinMouse_5-1638449063242.png

 

Is there a way to accomplish this task? Or does the matrix visual just ignore the blank cells when it comes to conditional formatting when the color is returned by a measure?

 

Thanks a lot for any hints into the right direction!

 

=> Link to PBX with dummy files.

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try like

 

new measure = [_countingMeasure] +0 

_colorBackgroundAllBlanks = 
IF([_countingMeasure] =0 , "Red", "Yellow")

 

Blank will not color, even if we use isblank. We need to have a measure with a 0 value .

 

Try to use measure only in conditional formatting and not in visual and check if that works

Anonymous
Not applicable

Hi @amitchandak, thanks for your suggestion!

You mean to use the new measure in _colorBackgroundAllBlanks?

 

new measure = [_countingMeasure] +0 

_colorBackgroundAllBlanks = 
IF([new measure] = 0, "Red", "Yellow")

 

 Sadly, it does not seem to work. I still get the same table as earlier:

MuffinMouse_0-1638453801549.png

And even if I use the new measure directly in the matrix, I can't get it to display the zeros. (Which is very strange, in another report I get the zeros by adding "+0" with no issues.)

Do I interpret your answer correctly that regarding the main issue with coloring the current week's column including blanks - it is not possible to do so at the moment unless maybe we add in zeros to the matrix, change their font color so they're invisible, etc. ?

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.