Forum Discussion

Sara_J's avatar
Sara_J
Frequent Visitor
2 years ago
Solved

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. 

 to   

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

 

 

 

 

3 Replies

  • Anonymous's avatar
    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:

     

    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.
     
    • Sara_J's avatar
      Sara_J
      Frequent Visitor

      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! 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Good luck!