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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
wkeicher
Helper III
Helper III

Conditional Formatting based on Matrix Columns

Hi I am trying to format columns where the value of column 2 is greater than the value in Coumn 1 in a Matrix Visual.CondFormat.png

1 ACCEPTED SOLUTION
JIGAR
Resolver IV
Resolver IV

@wkeicher 

 

You can create a measure something like this

 

ColorFormat = SWITCH(
TRUE()
,SUM(Test2[Column2]) > SUM(Test2[Column1]), "#f44242","#F2C80F")
 
Column2 = ActualInternalCost, Column 1 = AllocatedInternalCost in your case.
 
After creating this measure, create a matrix using your columns. On ActualInternalCost set the conditional formatting for font colors/background color. 
 
On conditional formatting pop up, select Field Value in the Format By dropdown. 
Select the measure you created earlier in the Based on Field dropdown. You should be able to see the conditional formatting. Please see the screenshot below
 
Capture.PNG
 
Hope this helps !! Please mark the answer as accepted solution if you find it appropriate..
 
Thanks

View solution in original post

3 REPLIES 3
JIGAR
Resolver IV
Resolver IV

@wkeicher 

 

You can create a measure something like this

 

ColorFormat = SWITCH(
TRUE()
,SUM(Test2[Column2]) > SUM(Test2[Column1]), "#f44242","#F2C80F")
 
Column2 = ActualInternalCost, Column 1 = AllocatedInternalCost in your case.
 
After creating this measure, create a matrix using your columns. On ActualInternalCost set the conditional formatting for font colors/background color. 
 
On conditional formatting pop up, select Field Value in the Format By dropdown. 
Select the measure you created earlier in the Based on Field dropdown. You should be able to see the conditional formatting. Please see the screenshot below
 
Capture.PNG
 
Hope this helps !! Please mark the answer as accepted solution if you find it appropriate..
 
Thanks

Small Issue - When I apply the formatting to the following - I do not get the desired result. It works for all other feilds. I suspect it has to do with not being able to Sum(Total_Actual_Cost) because it is already a Measure. Is there a work around?meas.png

@wkeicher 

 

I believe if you use columns on both the sides of (>) sign or measures on both the sides of (>) sign you should see the desired result. Please see the screenshot.

Capture.PNG

I can see you are using column on end side and measure on the other. 

 

Hope that helps !!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.