Forum Discussion
conditional formatting text that contains
- 9 years ago
Conditional formatting has only been available for a few months, and is nowhere near as mature as in Excel. You can't write your own rules unfortunately.
For doing the conditional formatting based on some text, i have come up with an solution, little round way but it should work.
For the above example - of Column Status, suppose you have below expected text.
Started
In progress
Deferred
Completed
First create images for all these text with your preferred color and save as Started.PNG etc.
Create a new column with serching these value into the Column and reference the images as we URL as below -
CalculatedStatus = SWITCH(
TRUE(),
SEARCH("Started", [Status], 1, 0) > 0, "http://localhost/images/Started.png",
SEARCH("In Progress", [Status], 1, 0) > 0, "http://localhost/images/InProgress.png",
SEARCH("Deferred", [Status], 1, 0) > 0, "http://localhost/images/Deffered.png",
SEARCH("Completed", [Status], 1, 0) > 0, "http://localhost/images/Completed.png","http://localhost/images/Blank.png")
This will create a new Column - CalculatedStatus with all URL of images you created above.
Goto Modeling option from PowerBI Desktop for that Column and convert this type to Image URL.
Publish it by using the new Column into your reports and you would be having colorful status.
Note: Sometime you don't see the images into PowerBI Desktop app, but published report will show the images.