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
GingerBeardDan
Regular Visitor

Conditional Formatting value in a matrix against a different source's column

I have a matrix and the value is a count of the inputs.

I want to add conditional formatting to the matrix field should the number match a value i have in a separate table.

I have created a relationship between the two sources but i cannot seem to find a way to do this.

1 ACCEPTED SOLUTION
mh2587
Super User
Super User

Create a measure to count the inputs (e.g., CountOfInputs = COUNT(InputsTable[InputID])).

Create a measure to compare the count against the threshold value from the other table:

If the threshold table has one value:
MatchThreshold = IF([CountOfInputs] = SELECTEDVALUE(ThresholdTable[TargetCount]), 1, 0)

If related by category or another key:
MatchThreshold = IF([CountOfInputs] = RELATED(ThresholdTable[TargetCount]), 1, 0)

Optionally, create a color-returning measure:
MatchColor = IF([CountOfInputs] = RELATED(ThresholdTable[TargetCount]), "#FF0000", "#FFFFFF")

Go to the matrix visual in Power BI.

Click the dropdown arrow on the values field.

Choose "Conditional formatting" > "Background color" or "Font color".

Set "Format by" to "Field value".

Choose the color measure (MatchColor) or logical measure (MatchThreshold) as the formatting field.

Apply the formatting.


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

3 REPLIES 3
v-tsaipranay
Community Support
Community Support

Hi @GingerBeardDan ,

Thank you for reaching out to Microsoft fabric community form.The approach provided by @mh2587  is correct, I wanted to check if you had the opportunity to review the information provided.

 

Using a combination of a count measure, a comparison against the threshold (via RELATED or SELECTEDVALUE), and then applying a conditional formatting rule using either a boolean or color-returning measure. Make sure your relationship is correctly defined and that the threshold table has appropriate granularity (e.g., one row per category if that's the matching key).

 

Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

 

Hi @GingerBeardDan ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

mh2587
Super User
Super User

Create a measure to count the inputs (e.g., CountOfInputs = COUNT(InputsTable[InputID])).

Create a measure to compare the count against the threshold value from the other table:

If the threshold table has one value:
MatchThreshold = IF([CountOfInputs] = SELECTEDVALUE(ThresholdTable[TargetCount]), 1, 0)

If related by category or another key:
MatchThreshold = IF([CountOfInputs] = RELATED(ThresholdTable[TargetCount]), 1, 0)

Optionally, create a color-returning measure:
MatchColor = IF([CountOfInputs] = RELATED(ThresholdTable[TargetCount]), "#FF0000", "#FFFFFF")

Go to the matrix visual in Power BI.

Click the dropdown arrow on the values field.

Choose "Conditional formatting" > "Background color" or "Font color".

Set "Format by" to "Field value".

Choose the color measure (MatchColor) or logical measure (MatchThreshold) as the formatting field.

Apply the formatting.


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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