cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danningkong
Helper I
Helper I

Conditional Formatting in table by field value

Hello,

 

I am not sure if I misunderstood the Microsoft Document (https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting), which says it can be a measure. If it means the terminology "Measure" in Power BI, I don't have the luck to get this to work on a "Measure", which is preferred from my point of view, instead of creating calculated column. Did anyone succeed in using a "Measure"? My experience is it is simply not selectable.

Color formatting by field value

You can use a measure or a column that specifics a color, either using a text value or a hex code, to apply that color to the background of font color of a table or matrix visual. You can also create custom logic for a given field, and have that logic apply the desired color to the font or background.

 

Regards

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @danningkong ,

 

One sample for your reference. Please check the following steps as below.

 

1. Create a measure as below.

Measure = 
VAR a =
    SUM ( 'Table'[value] )
RETURN
    SWITCH ( TRUE (), a <= 12, "#143DFF", a <= 14, "#FD09DE", "#DE8F12" )

2. Format the visual by thea measure as below.

 

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @danningkong ,

 

One sample for your reference. Please check the following steps as below.

 

1. Create a measure as below.

Measure = 
VAR a =
    SUM ( 'Table'[value] )
RETURN
    SWITCH ( TRUE (), a <= 12, "#143DFF", a <= 14, "#FD09DE", "#DE8F12" )

2. Format the visual by thea measure as below.

 

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

Thanks. The dropdown menu didn't show up the measure at the begining until I draged and dropped the measure to the visual then it was able to locate it. Of course I then dropped the unwanted measure later. It's a bit strange as I don't have to perform the additonal step to find the measure.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!