Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
israelcevans
Advocate II
Advocate II

KPI JSON properties

Hello!

Does anyone know of a way to change a KPI's Data Label color and Font size? 

I'm currently trying this (inside of a larger "visualStyles" bit of markup) to no avail.

 

"kpi": {
"*": { "dataLabel": [{ "solid":{"color":"#ff0000"}, "textSize": 24 }], "border": [{ "show": true }] } }

 

 

 

This has been a helpful link so far, but even that doesn't seem to cover everything. 

https://app.powerbi.com/view?r=eyJrIjoiMmMwZjU2MjUtZDA5NS00OWQ4LTgzMDMtNTM0NTcwMzQ4M2EwIiwidCI6IjRmM...

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @israelcevans ,

 

After my testing, properties that have not appeared on the format tab cannot be defined using json. You cannot do it because kpi visual doesn't have the "label" property.

However, you could post your idea here,  maybe it will be a feature of Power BI  in the future.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thanks for the reply @v-eachen-msft . 

 

What I mistook for a KPI was actually a Card Element. I found I'm able to do quite a bit with that element when it comes to the fill, the outline, border, and such, but I haven't found the right property name for the text.  This is what I'm currently using: 

 

    "actionButton": {
            "*": {
                "visualHeader": [
                    {
                        "show": true
                    }
                ],
                "border": [
                    {
                        "show": false
                    }
                ],
                "buttonText": [
                    {
                        "$id": "default",
                        "transparency": 0,
                        "fontColor": { "solid": { "color": "#ff0000" } },
                        "Color": { "solid": { "color": "#ff0000" } },
                        "textColor": { "solid": { "color": "#ff0000" } }
                    }
                ],
                "fill": [
                    {
                        "show": true
                    },
                    {
                        "$id": "default",
                        "transparency": 0,
                        "fillColor": { "solid": { "color": "#66bc43" } }
                    },
                    {
                        "$id": "hover",
                        "transparency": 40,
                        "fillColor": { "solid": { "color": "#66bc43" } }
                    },
                    {
                        "$id": "selected",
                        "transparency": 20,
                        "fillColor": { "solid": { "color": "#66bc43" } }
                    }
                ],
                "outline":[
                    {
                        "show": false 
                    },
                    {
                        "$id": "default",
                        "lineColor": {"solid": {"color": "#000000"}},
                        "transparency": 0,
                        "weight": 0,
                        "roundEdge": 0
                    },
                    {
                        "$id": "hover",
                        "lineColor": {"solid": {"color": "#000000"}},
                        "transparency": 0,
                        "weight": 0,
                        "roundEdge": 0
                    },
                    {
                        "$id": "selected",
                        "lineColor": {"solid": {"color": "#000000"}},
                        "transparency": 0,
                        "weight": 0,
                        "roundEdge": 0
                    }

                ]

            }
        }

buttonText doesn't seem to be the right name, as you can see, I'm also flailing about trying different names for the color under there, but nothing so far has worked. Would you have any ideas on this one? 

 

Thanks!

Hi @israelcevans ,

 

There isn't json property of border in the table. I think you could only edit the properties which have JSON.cardName.

1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors