Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Changing FONT Style/Size/Color in a DAX

Hi Super Users,

I need to show dynamic insights about my data.
I am creating a DAX using concatenate function and the measure and finally displaying it in a KPI Card.
The challenge is i need to highlight my measure used in a different color/size and style so its easily readable. this has to be controlled within a DAX.

Example : This is what i need to show
Sales for CY has incraesed by 20%


If i use the following measure:
Measure = "Sales for CY has increased by" & [Sales Growth%]

and use this in my KPI card - it will not highlight 20%(which i want to be highlighted in a different color/fornt style/size)

Pls help

4 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Anonymous If you use a card visual, you can conditional format the value using conditional formatting. https://radacad.com/enhance-the-card-visual-in-power-bi-with-conditional-formatting

     

    The new text box allows you to add data values and format them differently from the surrounding text: https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-smart-narrative 

     

    There are also custom visuals, such as Enlighten Data Story, which allow you to format text differently from the data values. 

     

    Since the card visual is the only one that will allow conditional formatting based on the data value, you may need to use a combination of these to get your desired result. 

  • Anonymous 

    Power BI does not provide such options yet for you to partially format text. as an alternative, you can create two measures one for the text "Sales for CY has increased by" and another one for your measure % which is 20%. then use two cards, shapes, or buttons to assign using the Text property, do the alignment right, and group these two objects to get the desired results.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could go to Format pane-->Goal -->Change label and value and percentage 's color/ font...

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Could you tell me if @sm_talha 's post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌

     

    Best Regards,
    Eyelyn Qin