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
Joe_Grosskopf
Helper II
Helper II

Trying to set a color based on field value

I have a column that simply calculates a Y or N based on some other columns in the dataset. I am atempting to change a guage fill color based on the Y or N....It is defaulting to First or Last....what is First or Last? I just wanted if "Y" make Green, if "N" make Red.

1 ACCEPTED SOLUTION
Syk
Super User
Super User

You can create a new column based on your Y/N column (or replace it) and assign numeric values instead. For example Y=1, N=0.
Then you can set your conditional rules to be <1 = red and >0 = green

View solution in original post

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @Joe_Grosskopf ,

 

Approve with @Syk .

Conditional formatting needs an aggregation or measure to be applied to the value. That's why you see 'First' or 'Last' in the Color by value example. 

Here’s one of the point provided in the Microsoft documentation, please check if these could help you a little.

Apply conditional table formatting in Power BI - Power BI | Microsoft Docs

 

Best Regards,

Jianbo Li

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

Joe_Grosskopf
Helper II
Helper II

That worked...thank you. I was under the impression you could simply compare two field values in the condition. Thanks Again

Syk
Super User
Super User

You can create a new column based on your Y/N column (or replace it) and assign numeric values instead. For example Y=1, N=0.
Then you can set your conditional rules to be <1 = red and >0 = green

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.