Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Helper I
Helper I

conditional formatting as string instead of color

hi! I found a nice guide to create conditional formatting.

However, this shows only the creation of conditional formatting with color. How can I create one that returns a string and not a color?

Resolver I
Resolver I

Hi @Balogh1Bence


Create a Calculated Column: Create a new calculated column in your data model that contains the string values you want to use for conditional formatting. You can use DAX (Data Analysis Expressions) to create this calculated column.


For example -   StatusText =
IF([Sales] > 1000, "High", IF([Sales] > 500, "Medium", "Low"))


Use the calculated column (StatusText in this example) instead of the original numeric or date column. You can display this column as-is without any further conditional formatting.


This approach allows you to display strings based on conditions, but it's not dynamic conditional formatting in the sense of changing the appearance of visual elements based on conditions.

Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
Please show the expected outcome based on the sample data you provided.


I have uploaded a pbix file and the code of a sample visual here:

Please open the report and go to edit mode. 
You will see some FX settings on the formatting pane.


I have also attached the code a ZIP file. There you can see how they are created. 
I would like to know how can I create similar settings but instead of color I want to use string.

you were using a custom visual.


see attached

Can you help with this?

Please be more specific. Have you looked at my proposal?

Yes I know. We are trying to develop a visual that can do the thing I said before.

I have a pbix file that I would like to attach. How can I do that?

Helpful resources

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.