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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Balogh1Bence
Helper II
Helper II

conditional formatting as string instead of color

hi! I found a nice guide to create conditional formatting.
https://learn.microsoft.com/en-us/power-bi/developer/visuals/conditional-format?tabs=enumerateObject...

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

9 REPLIES 9
pradeep_kare12
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.

lbendlin
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.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi!

I have uploaded a pbix file and the code of a sample visual here:
https://github.com/Balogh1Bence/fx

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

Balogh1Bence_2-1695741919552.png

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

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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