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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SamOvermars
Helper I
Helper I

Conditional formatting is not working as expected

Hello,

I created a column that has the "Goal Color" its either red or green, but when I go to setup the conditional formatting its asking for summarization like this 

SamOvermars_0-1686057233542.png


I tried to pick Minimum but the color is always showing Red which represent 1, if I do the same for Max it will always show Green.
Heres the dax that Im using for the conditional formatting column
Goal Color =
VAR Value_From_Table1 = Table1[Column1]
VAR Category_From_Table2 = RELATED(Table2[Category])
RETURN
SWITCH (
TRUE(),
AND(Category_From_Table2 = "Category_A", Value_From_Table1 <= 10), 1,
AND(Category_From_Table2 = "Category_B", Value_From_Table1 <= 12), 1,
AND(Category_From_Table2 = "Category_C", Value_From_Table1 <= 55), 1,
AND(Category_From_Table2 = "Category_D", Value_From_Table1 <= 10), 1,
AND(Category_From_Table2 = "Category_E", Value_From_Table1 <= 14), 1,
2
)

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

Hi @SamOvermars ,

It looks like you are trying to set up conditional formatting based on a calculated column in Power BI. When you set up conditional formatting, you need to choose a summarization function to apply to the column in order to determine the color scale.

 

Have a try:

1. Select the visual or table where you want to apply the conditional formatting.
2. Click on the "Conditional formatting" button in the formatting pane.
3. Choose "Background color" from the dropdown menu.
4. Select "Color scale" from the options.
5. Choose "Minimum" for the summarization function and select the color red.
6. Choose "Maximum" for the summarization function and select the color green.

This should set up a color scale where the minimum value of the "Goal Color" column is red and the maximum value is green.

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @SamOvermars ,

It looks like you are trying to set up conditional formatting based on a calculated column in Power BI. When you set up conditional formatting, you need to choose a summarization function to apply to the column in order to determine the color scale.

 

Have a try:

1. Select the visual or table where you want to apply the conditional formatting.
2. Click on the "Conditional formatting" button in the formatting pane.
3. Choose "Background color" from the dropdown menu.
4. Select "Color scale" from the options.
5. Choose "Minimum" for the summarization function and select the color red.
6. Choose "Maximum" for the summarization function and select the color green.

This should set up a color scale where the minimum value of the "Goal Color" column is red and the maximum value is green.

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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