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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
KH11NDR
Helper IV
Helper IV

Change matrix table column bg colours if month less than current month?

Hi,

 

Is it possible to change matrix table column bg colours if month less than current month?

 

Thanks

10 REPLIES 10
KH11NDR
Helper IV
Helper IV

Is there nowhere I can write

 

=if(Table[column])<=Month(Today()), Red, Green ?

Hi KH11NDR ,

 

In your senario, you can use conditional formatting to achieve your requirement.https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting.

 

Regards,

Jimmy Tao

You can only add one numeric figure into the input boxes if I'm correct, how will I implement this using the set way in conditional formatting?

Hey @KH11NDR


Numeric inputs can actually work wonders. You are really close with your conditional statement. There are two things to achieve it, a) because it's going to be used in a table visual, you'll need a measure which always takes the current row and b) you can then use that numeric output of the measure to conditional format other columns however you want:

MonthCheck =
VAR m =
    SELECTEDVALUE ( Table[column] )
RETURN
    IF ( m <= MONTH ( TODAY () ), 0, 1 )

This measure will return 0 if it's in this or any previous month and 1 if it's not.
Then, in conditional formatting, you can choose to format your column depentant on this measure, with two rules:
i) if equals 0 then red,
ii) if equals 1 then green

🙂

 

 




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

I've tried it, do I add the Measure or the variable? I can only see the Measure and not the variable, so Added the measure and the condition is working for the values in the month rather than the Month.  Nearly there lol

Yeah I was thinking about that because your month column may be text, while MONTH() returns an integer. If you have a date column it would make it a lot easier by checking if [date] <= EOMONTH(TODAY() , 0 )




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

Is there an option to add conditional formatting to a column? If not, there should be.

I could have added this measure to the conditional format on column if available.

 

Month Condition = IF('Master Calendar'[Current Month Condition]>=MONTH(TODAY()),1,0)

I'll give that a go, but it sounds like the perfect solution and now I can see how it works, create the code in a measure and then use the numeric fields, cool. I get it now.  I knew there would be a easy logical way round it.

I've already read that, but I can't work out to do what I want.  They've made it so difficult, it would be so easy if they had a bit where you can write your own code.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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