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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Power Bi Json Theme - Pivot Table Row Subtotal Formatting not working

Hi, I am creating a json Theme file for my company and I am stuck on the matrix table. It just doesnt take the inputs for row subtotals.

Here's the code:

 

 

{
    "name": "Test",
    "pivotTable": {
        "*": {
            "stylePreset": [
                {
                    "name": "Default"
                }
            ],
            "grid": [
                {
                    "gridVertical": false,
                    "gridHorizontal": false,
                    "rowPadding": 4,
                    "outlineWeight": 2,
                    "textSize": 10
                }
            ],
            "columnHeaders": [
                {
                    "fontColor": {
                        "solid": {
                            "color": "#ffffff"
                        }
                    },
                    "backColor": {
                        "solid": {
                            "color": "#142640"
                        }
                    },
                    "outline": "None",
                    "outlineColor": {
                        "solid": {
                          "color": "#0e1622"
                        }
                    },
                    "outlineWeight": 1,
                    "autoSizeColumnWidth": true,
                    "fontFamily": "Calibri",
                    "fontSize": 10,
                    "bold": true,
                    "alignment": "Left",
                    "titleAlignment": "Left",
                    "wordWrap": true
                }
            ],
            "rowHeaders": [
                {
                    "fontColor": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "outline": "RightOnly",
                    "outlineColor": {
                        "solid": {
                          "color": "#0e1622"
                        }
                    },
                    "outlineWeight": 1,
                    "stepped": true,
                    "steppedLayoutIndentation": 10,
                    "wordWrap": true,
                    "fontFamily": "Calibri",
                    "fontSize": 10,
                    "alignment": "Left",
                    "showExpandCollapseButtons": true
                }
            ],
            "values": [
                {
                    "fontColorPrimary": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "backColorPrimary": {
                        "solid": {
                            "color": "#ffffff"
                        }
                    },
                    "fontColorSecondary": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "backColorSecondary": {
                        "solid": {
                            "color": "#F4F4F4"
                        }
                    },
                    "bandedRowHeaders": true,
                    "valuesOnRow": true,
                    "wordWrap": true,
                    "fontFamily": "Calibri",
                    "fontSize": 10
                }
            ],
            "subTotals": [
                {
                    "rowSubtotals": true,
                    "columnSubtotals": true,
                    "fontColor": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "fontFamily": "Calibri",
                    "fontSize": 10,
                    "applyToHeaders": true,
                    "applyToLabels": true
                }
            ],
            "rowTotal": [
                {
                    "fontColor": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "fontFamily": "Calibri",
                    "fontSize": 10,
                    "applyToHeaders": true
                }
            ],
            "columnTotal": [
                {
                    "fontColor": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "fontFamily": "Calibri",
                    "applyToHeaders": true,
                    "fontSize": 10
                }
            ],         
            "totals": [
                {
                    "fontColor": {
                        "solid": {
                            "color": "#0e1622"
                        }
                    },
                    "fontFamily": "Calibri",
                    "bold": true,
                    "applyToHeaders": true,
                    "applyToLabels": true,
                    "fontSize": 10
                }
            ]
        }
    }
}

 

 

When I load it into the report there's these two that don't do what I want (see attached pics):
- Column grand total needs to be Calibri 10, apply to labels true
- Row subtotals needs to also be Calibri 10,apply to labels true

 

I also included a pic of current vs desired. Please let me know what I did wrong!

Michella_0-1700215258935.pngMichella_1-1700215263964.pngMichella_2-1700215266519.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Ok, solved it myself after trying different stuff. I had to go to the subtotals section and define font for rowsubtotals and columnsubtotals separately., like so: 

"rowSubtotals": true,
"fontFamilyrowSubtotals": "Calibri",
"fontSizerowSubtotals": 10,
"columnSubtotals": true,
"fontFamilycolumnSubtotals": "Calibri",
"fontSizecolumnSubtotals": 10

 

This is the whole solution:

 

{
	"name": "MatrixTemplate",
	"visualStyles": {
		"pivotTable": {
			"*": {
					"stylePreset":[{
                    			"name":"Default"
                			}],
					"grid": [{
					"gridVertical": false,
					"gridVerticalColor": { "solid": { "color": "#F4F4F4"}},
					"gridVerticalWeight": 2,
					"gridHorizontal": false,
					"gridHorizontalColor": { "solid": { "color": "#F4F4F4"}},
					"gridHorizontalWeight": 2,
					"rowPadding": 4,
					"outlineColor": { "solid": { "color": "#F4F4F4"}},
					"outlineWeight": 2,
					"textSize": 10,
					"imageHeight": 100
				}],
				"columnHeaders": [{
					"fontColor": { "solid": { "color": "#ffffff"}},
					"backColor": { "solid": { "color": "#142640"}},
					"autoSizeColumnWidth": true,
					"fontFamily": "Calibri",
					"fontSize": 10,
                    "bold": true,
					"alignment": "Left",
					"titleAlignment": "Left",
					"urlIcon": true,
					"wordWrap": true
				}],
				"rowHeaders": [{
					"fontColor": { "solid": { "color": "#0e1622"}},
					"backColor": { "solid": { "color": "#ffffff"}},
					"outline": "Frame",
                    "outlineColor": { "solid": { "color": "#142640"}},
                    "outlineWeight": 1,
					"stepped": true,
					"steppedLayoutIndentation": 12,					
					"urlIcon": true,
					"wordWrap": true,
					"fontFamily": "Calibri",
					"fontSize": 10,
					"alignment": "Left", 
					"showExpandCollapseButtons":true
				}],
				"values": [{
					"fontColorPrimary": { "solid": { "color": "#0e1622"}},
					"backColorPrimary": { "solid": { "color": "#ffffff"}},
					"fontColorSecondary": { "solid": { "color": "#0e1622"}},
					"backColorSecondary": { "solid": { "color": "#F4F4F4"}},
					"bandedRowHeaders": true,
					"valuesOnRow": true,
					"outline": "Frame",
					"urlIcon": true,
					"wordWrap": true,
					"fontFamily": "Calibri",
					"fontSize": 10
				}],
				"subTotals": [{
                    "rowSubtotals": true,
                    "fontFamilyrowSubtotals": "Calibri",
					"fontSizerowSubtotals": 10,
                    "columnSubtotals": true,
                    "fontFamilycolumnSubtotals": "Calibri",
					"fontSizecolumnSubtotals": 10,
					"applyToHeaders": true,
					"perRowLevel": true,
					"perColumnLevel": true					
				}]
			}
		}
	}
}

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Ok, solved it myself after trying different stuff. I had to go to the subtotals section and define font for rowsubtotals and columnsubtotals separately., like so: 

"rowSubtotals": true,
"fontFamilyrowSubtotals": "Calibri",
"fontSizerowSubtotals": 10,
"columnSubtotals": true,
"fontFamilycolumnSubtotals": "Calibri",
"fontSizecolumnSubtotals": 10

 

This is the whole solution:

 

{
	"name": "MatrixTemplate",
	"visualStyles": {
		"pivotTable": {
			"*": {
					"stylePreset":[{
                    			"name":"Default"
                			}],
					"grid": [{
					"gridVertical": false,
					"gridVerticalColor": { "solid": { "color": "#F4F4F4"}},
					"gridVerticalWeight": 2,
					"gridHorizontal": false,
					"gridHorizontalColor": { "solid": { "color": "#F4F4F4"}},
					"gridHorizontalWeight": 2,
					"rowPadding": 4,
					"outlineColor": { "solid": { "color": "#F4F4F4"}},
					"outlineWeight": 2,
					"textSize": 10,
					"imageHeight": 100
				}],
				"columnHeaders": [{
					"fontColor": { "solid": { "color": "#ffffff"}},
					"backColor": { "solid": { "color": "#142640"}},
					"autoSizeColumnWidth": true,
					"fontFamily": "Calibri",
					"fontSize": 10,
                    "bold": true,
					"alignment": "Left",
					"titleAlignment": "Left",
					"urlIcon": true,
					"wordWrap": true
				}],
				"rowHeaders": [{
					"fontColor": { "solid": { "color": "#0e1622"}},
					"backColor": { "solid": { "color": "#ffffff"}},
					"outline": "Frame",
                    "outlineColor": { "solid": { "color": "#142640"}},
                    "outlineWeight": 1,
					"stepped": true,
					"steppedLayoutIndentation": 12,					
					"urlIcon": true,
					"wordWrap": true,
					"fontFamily": "Calibri",
					"fontSize": 10,
					"alignment": "Left", 
					"showExpandCollapseButtons":true
				}],
				"values": [{
					"fontColorPrimary": { "solid": { "color": "#0e1622"}},
					"backColorPrimary": { "solid": { "color": "#ffffff"}},
					"fontColorSecondary": { "solid": { "color": "#0e1622"}},
					"backColorSecondary": { "solid": { "color": "#F4F4F4"}},
					"bandedRowHeaders": true,
					"valuesOnRow": true,
					"outline": "Frame",
					"urlIcon": true,
					"wordWrap": true,
					"fontFamily": "Calibri",
					"fontSize": 10
				}],
				"subTotals": [{
                    "rowSubtotals": true,
                    "fontFamilyrowSubtotals": "Calibri",
					"fontSizerowSubtotals": 10,
                    "columnSubtotals": true,
                    "fontFamilycolumnSubtotals": "Calibri",
					"fontSizecolumnSubtotals": 10,
					"applyToHeaders": true,
					"perRowLevel": true,
					"perColumnLevel": true					
				}]
			}
		}
	}
}

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.