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
Sara_J
Frequent Visitor

How to format part of a dynamic text to be bold with different font color

Hi,

I have a dynamic string to show values based on swtich statements. I need to format the value to be bold and different color. 

Sara_J_3-1698159711464.png to   Sara_J_2-1698159693569.png

Below is the dax code : Please advise on code to format the color and bold as above.

==========================================
Statement =
Var Curr = [Ratio]
Var A = switch(true(),Curr >1,">1",Curr <1,"<1","=1")
Var B = " for " & [Latest Month] & "; " & "data lagged due to data stabiliztaion"
Var string = A & B
return
string
=======================================
 work around solution could be to break into 3 shapes and format first part.
 
Thanks,
Sara

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

There are several HTML visuals available that might help, e.g. HTML Text Styler or HTML content. HTML Text Styler for example, in HTML Text Styler, the measure below will create this output:

AlexBr_1-1698201558849.png

 

Sample = CONCATENATE(" <span style= 'color:rgb(0, 0, 255);'><b>"&[This is the Text]&"</b></span>", "; data lagged due to data stabilisation")
 
You can replace the 'This is the Text' measure with your own code and the second part of the CONCATENATE you could replace the simple string with another measure.
 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Good luck!

Anonymous
Not applicable

There are several HTML visuals available that might help, e.g. HTML Text Styler or HTML content. HTML Text Styler for example, in HTML Text Styler, the measure below will create this output:

AlexBr_1-1698201558849.png

 

Sample = CONCATENATE(" <span style= 'color:rgb(0, 0, 255);'><b>"&[This is the Text]&"</b></span>", "; data lagged due to data stabilisation")
 
You can replace the 'This is the Text' measure with your own code and the second part of the CONCATENATE you could replace the simple string with another measure.
 

Thank you for the solution.
i downloaded the HTML visualization . While few available not displaying the results on Cloud service . HTML text styler does display the expected solution.
How ever i still need it to approved by my organization and needs licensing.


Thanks again! 

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.