Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dear PowerBi Community,
I'm trying to develop a custom PowerBi report json theme according to the Corporate Identity (CI) of the organisation that I work for.
While I have come across a very helpful github repository at https://github.com/MattRudy/PowerBI-ThemeTemplates, I'm currently struggling to get the tables to look as required by our CI without manual formatting via 'Format visual' using a custom json theme.
According to our CI design tables should have a reddish grid border on the left of the table as shown in the example table below that I can easily achieve via manual formatting as shown:
What I'm currently getting based on my json code snippet below is the following table with reddish grid borders at the top and bottom as shown in the follwong example table:
How do I set the table grid border position in my json file?
I tried via "grid":[{"outline":"LeftOnly"}] but it doesn't seem to have any effect...
Any pointers and suggestions how to set the table grid border position via json would be highly appreciated so that I don't need to manually edit all tables in my reports.
Many thanks in advance!
"tableEx": {
"*": {
"general": [{
"responsive": true,
"keepLayerOrder": true
}],
"stylePreset": [{
"name": "ContrastAlternatingRows"
}],
"background": [{
"show": false,
"color": { "solid": { "color": "#ffffff"}},
"transparency": 0
}],
"border": [{
"show": false,
"color": { "solid": { "color": "#d17559"}},
"radius": 0
}],
"title": [{
"show": true,
"fontColor": { "solid": { "color": "#d17559" } },
"background": { "solid": { "color": "#ffffff" } },
"alignment": "left"
}],
"grid": [{
"gridVertical": false,
"gridVerticalColor": { "solid": { "color": "#d17559"}},
"gridVerticalWeight": 1,
"gridHorizontal": false,
"gridHorizontalColor": { "solid": { "color": "#ffffff"}},
"gridHorizontalWeight": 1,
"rowPadding": 1,
"outlineColor": { "solid": { "color": "#d17559"}},
"outlineWeight": 1,
"outline": "LeftOnly",
"textSize": 12,
"imageHeight": 100
}],
"columnHeaders": [{
"fontColor": { "solid": { "color": "#005b96"}},
"backColor": { "solid": { "color": "#ffffff"}},
"outline": "LeftOnly",
"autoSizeColumnWidth": true,
"fontFamily": "Calibri",
"fontSize": 11,
"alignment": "Left",
"wordWrap": true
}],
"values": [{
"fontColorPrimary": { "solid": { "color": "#4f4e51"}},
"backColorPrimary": { "solid": { "color": "#afd6f2"}},
"fontColorSecondary": { "solid": { "color": "#4f4e51"}},
"backColorSecondary": { "solid": { "color": "#ffffff"}},
"outline": "Frame",
"urlIcon": true,
"wordWrap": true,
"fontFamily": "Calibri",
"fontSize": 10
}],
"total": [{
"totals": true,
"fontColor": { "solid": { "color": "#005a96"}},
"backColor": { "solid": { "color": "#ffffff"}},
"outline": "Frame",
"fontFamily": "Calibri",
"fontSize": 10
}]
}
Country | Sum of Sales |
Canada | 24887654885 |
France | 2435417228 |
Germany | 2350534082 |
Mexico | 2094935211 |
United States of America | 25029830165 |
Hi @janstrauss1 ,
Yeah, this is super frustrating. You've basically run into one of Power BI's annoying limitations with JSON themes. The "outline": "LeftOnly" thing just doesn't work properly in custom themes, even though it works fine when you do it manually.
What's happening: Power BI's theme system is honestly pretty inconsistent. Some stuff that works in the Format pane just gets ignored in JSON themes. It's been like this for ages and Microsoft hasn't really fixed it.
Your realistic options:
Just do it manually (honestly probably easiest) Set up your JSON theme for all the colors and basic stuff, then just accept you'll have to manually set the border direction for each table. At least the colors will be consistent.
Try a workaround with shapes Turn off all the table borders in your theme, then manually add a thin rectangle shape positioned on the left side of each table. Not ideal but it'll look the same.
Copy/paste approach Format one table exactly how you want it, then copy and paste that table whenever you need a new one. The formatting sticks when you copy it.
Template report Create a template report with pre-formatted tables and just duplicate that for new reports.
I know none of these are the clean solution you wanted, but that's just how Power BI themes work unfortunately. The JSON schema is missing a bunch of formatting options that exist in the UI.
Pretty annoying when you're trying to maintain consistent branding across reports.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
Hi @janstrauss1 ,
Power BI's JSON theme schema unfortunately does not currently support setting grid borders on only the left side of a table visual through the outline property in the way you might expect — especially not for the "tableEx" visual type.
The property "outline": "LeftOnly" is intended to mimic the UI "Outline" setting for gridlines or headers, but, as you've experienced, it does not consistently apply the left border only when used in a custom theme JSON.
Power BI will not show only the left border; instead it defaults to either none or all sides, depending on other settings and Power BI version
Possible workarounds to get this specific border color on left side only :
1. Manually adjust each table visual via the Format pane:
Go to Visual > Grid > Outline
Set it to Left only
Set the Outline color to #d17559
2. You can at least make the grid lines transparent or white on top/bottom to simulate a single left border — not perfect but can help.
json
"grid": [{
"gridVertical": false,
"gridHorizontal": false,
"outline": "Frame",
"outlineColor": { "solid": { "color": "#ffffff" } }, // white all borders
"outlineWeight": 1
}],
"columnHeaders": [{
...
"outline": "LeftOnly",
"outlineColor": { "solid": { "color": "#d17559" } },
"outlineWeight": 2
}],
"values": [{
...
"outline": "LeftOnly",
"outlineColor": { "solid": { "color": "#d17559" } },
"outlineWeight": 2
}]
⭐Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
🚀Let’s keep building smarter, data-driven solutions together! 🚀 [Explore More]