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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Conditional Coloring

Hey Everyone,

 

I have a Power BI reort connects to Power Bi dataset as a live connection.

I have a table/matrix with financial numbers based on calendar months, and I would like to apply conditional background coloring:

* If month (number) is less (<) than current month then green if higher (>) then blue. 

 

Is that possible to achieve? 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Anonymous 

Does your Model or Date Table have a Month Column? Do you use that column?

 

BTW, you need to add a measure and use that in Color Conditional formatting like this:

Color M =
VAR _A =
    MONTH ( TODAY () )
VAR _B =
    MONTH ( MAX ( date[date] ) )
RETURN
    IF ( _B < _A, "Green", "Blue" )

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 FIFA World Cup - Medal Records 

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @Anonymous 

Does your Model or Date Table have a Month Column? Do you use that column?

 

BTW, you need to add a measure and use that in Color Conditional formatting like this:

Color M =
VAR _A =
    MONTH ( TODAY () )
VAR _B =
    MONTH ( MAX ( date[date] ) )
RETURN
    IF ( _B < _A, "Green", "Blue" )

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 FIFA World Cup - Medal Records 

 

Helpful resources

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