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.
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_person | person | weekNumber |
1 | Person A | 1 |
1 | Person A | 2 |
1 | Person A | 2 |
1 | Person A | 3 |
1 | Person A | 3 |
1 | Person A | 4 |
1 | Person A | 4 |
2 | Person B | 2 |
2 | Person B | 2 |
2 | Person B | 4 |
2 | Person B | 4 |
2 | Person B | 4 |
2 | Person B | 5 |
2 | Person B | 8 |
2 | Person B | 8 |
2 | Person B | 8 |
2 | Person B | 9 |
2 | Person B | 9 |
3 | Person C | 2 |
3 | Person C | 3 |
3 | Person C | 3 |
3 | Person C | 5 |
3 | Person C | 6 |
3 | Person C | 8 |
3 | Person C | 9 |
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.):
However, it only shows me this:
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")
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.
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!
@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
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:
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. ?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |