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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
alexlopesBS
Frequent Visitor

custom columnHeaders not working

Hi, 

 

I've been trying to make a columnHeader customization to a theme at my work, but it doesn't apply. I would like column header to be by default front: white, back: "#333", can anyone assist me on why it doesnt apply?

Here is the code:

{
    "name": "LASA",
    "dataColors": [ "#FF0000", "#7F2626", "#2F343B", "#374649", "#333333",  "#5F6B6D", "#FD625E"], 
    "background":"#FFFFFF",
    "foreground": "#333333",
    "tableAccent": "#FF0000",
    "visualStyles": {
        "*": {
            "*": {
                "*": [{
                    "responsive":true,
                    "wordWrap":true,
                    "fontFamily": "Segoe UI",
                    "fontColor": "#333333",
                    "labelColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    }                   
                }],
                "legend": [{
                    "fontSize": 11,
                    "color": "#333333",
                    "fontFamily": "wf_segoe-ui_bold"
                }],
                "labels": [{
                    "color": {
                        "solid": {
                            "color": "#333333"
                        }
                    }
                }],
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": "#FFFFFF",
                    "outline": 0
                }]
            }
        },
        "card": {
            "*": {
                "labels": [{
                    "fontSize":35,
                    "fontFamily": "wf_segoe-ui_bold",
                    "color": {
                        "solid": {
                            "color": "#FF0000"
                        }
                    }
                }],
                "categoryLabels": [{
                    "show":false
                }]
            }
        }
    }
}
1 ACCEPTED SOLUTION


@alexlopesBS wrote:

I will try different keys with bracers and see if I can figure it out.

 



 

Well, it turns out you have to use the "value" key inside the parameters if you want it to work. 

"tableEx": {
            "*" : {
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": {
                        "solid": {
                            "color": "#FFFFFF"
                        }
                    },
                    "outline": { "value": 0 },
                    "autoSizeColumnWidth": { "value": 1 }
                }]
            }
        },

 

Here is the fixed full code for future reference.

{
    "name": "LASA",
    "dataColors": [ "#FF0000", "#7F2626", "#2F343B", "#374649", "#333333",  "#5F6B6D", "#FD625E"], 
    "background":"#FFFFFF",
    "foreground": "#333333",
    "tableAccent": "#FF0000",
    "visualStyles": {
        "*": {
            "*": {
                "*": [{
                    "responsive":true,
                    "wordWrap":true,
                    "fontFamily": "Segoe UI",
                    "fontColor": "#333333",
                    "labelColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    }                   
                }],
                "legend": [{
                    "fontSize": 11,
                    "color": "#333333",
                    "fontFamily": "wf_segoe-ui_bold"
                }]
            }
        },
        "tableEx": {
            "*" : {
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": {
                        "solid": {
                            "color": "#FFFFFF"
                        }
                    },
                    "outline": { "value": 0 },
                    "autoSizeColumnWidth": { "value": 1 }
                }]
            }
        },
        "card": {
            "*": {
                "labels": [{
                    "fontSize":35,
                    "fontFamily": "wf_segoe-ui_bold",
                    "color": {
                        "solid": {
                            "color": "#FF0000"
                        }
                    }
                }],
                "categoryLabels": [{
                    "show":false
                }]
            }
        }
    }
}

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Hmm, the definite guide for themes that I could find seems to be here:

https://docs.microsoft.com/en-us/power-bi/desktop-report-themes

 

Couldn't see anything obviously wrong. Will have to spend a little time looking at it.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I was able to make the colors work after moving the parameters to the specific visualName "tableEx", but the outline and autoSizeColumnWidth values still doesn't work, I will try different keys with bracers and see if I can figure it out.

 

The documentation is a bit incomplete, unfortunately. 😞

 

"tableEx": {
            "*" : {
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": {
                        "solid": {
                            "color": "#FFFFFF"
                        }
                    },
                    "outline": 0,
                    "autoSizeColumnWidth": 1
                }]
            }
        },

 


@alexlopesBS wrote:

I will try different keys with bracers and see if I can figure it out.

 



 

Well, it turns out you have to use the "value" key inside the parameters if you want it to work. 

"tableEx": {
            "*" : {
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": {
                        "solid": {
                            "color": "#FFFFFF"
                        }
                    },
                    "outline": { "value": 0 },
                    "autoSizeColumnWidth": { "value": 1 }
                }]
            }
        },

 

Here is the fixed full code for future reference.

{
    "name": "LASA",
    "dataColors": [ "#FF0000", "#7F2626", "#2F343B", "#374649", "#333333",  "#5F6B6D", "#FD625E"], 
    "background":"#FFFFFF",
    "foreground": "#333333",
    "tableAccent": "#FF0000",
    "visualStyles": {
        "*": {
            "*": {
                "*": [{
                    "responsive":true,
                    "wordWrap":true,
                    "fontFamily": "Segoe UI",
                    "fontColor": "#333333",
                    "labelColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    }                   
                }],
                "legend": [{
                    "fontSize": 11,
                    "color": "#333333",
                    "fontFamily": "wf_segoe-ui_bold"
                }]
            }
        },
        "tableEx": {
            "*" : {
                "columnHeaders": [{
                    "backColor": {
                        "solid": {
                            "color": "#333333"
                        }
                    },
                    "fontColor": {
                        "solid": {
                            "color": "#FFFFFF"
                        }
                    },
                    "outline": { "value": 0 },
                    "autoSizeColumnWidth": { "value": 1 }
                }]
            }
        },
        "card": {
            "*": {
                "labels": [{
                    "fontSize":35,
                    "fontFamily": "wf_segoe-ui_bold",
                    "color": {
                        "solid": {
                            "color": "#FF0000"
                        }
                    }
                }],
                "categoryLabels": [{
                    "show":false
                }]
            }
        }
    }
}

Awesome, thanks for following up on this, I agree that the documentation is a bit of a mess. I think what would be really helpful would be for the Power BI team to publish an example theme that literally has every possible thing that you could ever want to customize in it and then everyone could just grab elements that they wanted from that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.