If you wanted more precision in the color to match your theme, you could substitute the specific hex codes where I have “Red” and “Black”.
Then go to Conditional Formatting and choose the “Field Value” option and then select this measure. (You can use this same measure regardless of whether you want to conditionally format the background or the font of your numbers.)
Thanx for the reply but my measure return the the string with number as i quoted above and when i apply conditional formatting it will apply to full output of my measure and i just want to colour the number part.
correct me i am missing some thing.
I am asking this question becuz my text is also dynamic in nature i can not make it hard codded.
Actually, in re-reading your response, I’m not sure exactly what you want the output to look like. If the above response doesn’t resolve your question, please attach a PBIX file and a mockup of the specific output you want to achieve.
I think you should look into the smart narritives visual.
That will allow you to set a different format for your measures, if you want to highlight them. Here’s a link to the documentation.
OK, I don’t think Smart Narrative will work here because I don’t think it yet supports conditional formatting. However, you can use the field value conditional format measure I specified above in a card visual, combined with another text-based card visual to accomplish your desired result . Here, I have the measure set to change the text to red if my sales measure is below $5 million.
Hi @Anurag. I had another thought about conditional formatting a text string inside Power BI: you could use the HTML Custom Visual from AppSource. You can use a simple measure like this to compose the HTML of the text you’d like to display along with colours, fonts, whatever, then simply add it to the custom visual.
Super cool… I’ve never played with this particular custom visual before, but will definitely give it a look now. You mentioned font settings – do you know whether it lets you bring in fonts not native to Power BI?
I’d imagine so … I’d guess anything that can be rendered in HTML would show as if on a web page. It’s my first time trying this custom visual, so can’t say for sure …
Greg