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
JustinDoh1
Post Prodigy
Post Prodigy

Conditional formatting in Matrix's value

Hi community,

 

I am sharing my Pbix file here.

 

I am trying to apply different Background colors on Matrix.

Here is my demo:

JustinDoh1_0-1647981920652.png

 

Currently, this Matrix has two parts.

Left side is Actual and right three columns are Estimate based on logic.

JustinDoh1_1-1647982058553.png

 

When I try to do the Conditional formating on the Value, it does not give me an option to choose either "Actual" or "Estimate".

It only gives me an option of Count and Distinct Count.

JustinDoh1_3-1647982327835.png

 

JustinDoh1_2-1647982205252.png

What I am trying to do is apply different background colors on Value depedning output of BudgetType is "Actual" or "Estimte".

How do we go about doing it with current model?

 

Thank you.

 

 

 

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@JustinDoh1 

You can write a measure to check on the BudgetType[ActualOrEstimated] and return a color string like this.

 

Value Format = 
VAR _Type = SELECTEDVALUE ( BudgetType[ActualOrEstimated] )
RETURN
SWITCH ( 
    TRUE (),
    _Type = "Actual", "Green",
    _Type = "Estimate", "Red"
)

 

Then apply conditional formatting to the Values background based on the Field value of the measure:

jdbuchanan71_0-1647983196758.png

jdbuchanan71_1-1647983218197.png

 

You can use color hex values instead also.

Value Format = 
VAR _Type = SELECTEDVALUE ( BudgetType[ActualOrEstimated] )
RETURN
SWITCH ( 
    TRUE (),
    _Type = "Actual", "#34A853",
    _Type = "Estimate", "#EA4335"
)

 

 

 

View solution in original post

2 REPLIES 2
JustinDoh1
Post Prodigy
Post Prodigy

@jdbuchanan71 Excellent! Thank you!

jdbuchanan71
Super User
Super User

@JustinDoh1 

You can write a measure to check on the BudgetType[ActualOrEstimated] and return a color string like this.

 

Value Format = 
VAR _Type = SELECTEDVALUE ( BudgetType[ActualOrEstimated] )
RETURN
SWITCH ( 
    TRUE (),
    _Type = "Actual", "Green",
    _Type = "Estimate", "Red"
)

 

Then apply conditional formatting to the Values background based on the Field value of the measure:

jdbuchanan71_0-1647983196758.png

jdbuchanan71_1-1647983218197.png

 

You can use color hex values instead also.

Value Format = 
VAR _Type = SELECTEDVALUE ( BudgetType[ActualOrEstimated] )
RETURN
SWITCH ( 
    TRUE (),
    _Type = "Actual", "#34A853",
    _Type = "Estimate", "#EA4335"
)

 

 

 

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