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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Problem with conditional formatting on specific month

I am new to Power BI and now stuck in writing a measure to do conditional formatting.

 

I want to show if the number of complaints in different business units increase from last month to current month. 

As it's still October now, conditional formatting should show the difference between August and September. Red refers to number increase, Green decrease, and yello when number is unchanged.  This is how it should look like (I did it in Excel):

 

jtseng_0-1635346252373.png

 

I tried to write a measure as below but it ends up applying to the entire visual and those that are empty are not calculated.

 

jtseng_3-1635347059975.png

 

jtseng_2-1635346820518.png

 

I have two questions here:

1. Can I only apply conditional formatting (background color) to October?

2. For those that are blank, how can I make it become 0 so that the measure can work for the conditional formatting? 

 

Thanks for helping!

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Add +0 to the measure so that will show 0 in place of blank

 

+0 can force left join, so I usuallt prefer.

 

0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))

 

 

If you need color on for oct.

 

the return blank() or white color in else

 

example

Colour =
SWITCH(TRUE(),
max('Table'[Month]) = "OCT", "red", //loop if or switch if needed
"White")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, 

+0 works for me now, Thank you!

However, I sitll can't put color only on September (sorry not October), because when I applied the color measure to conditioning formatting, it applies to the entire matrix.

 

Even if I add "white" at the end, it still shows yellow over the table, and there are green in August. What I want is only the row of September being colored. Can I add any conditional function in the measure to let it only put color on September?
 
Color =
IF(
CALCULATE(COUNT(Table[Number]), Table[Month]="September")-CALCULATE(COUNT(Table[Number]), Table[Month]="August") > 0, "red",
IF (
CALCULATE(Same as above) < 0, "lightgreen",
IF (
CALCULATE(Same as above) =0, "yellow",
"white")))
 
jtseng_0-1635868328909.png

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.