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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Martijn1
Frequent Visitor

In JSON theme: how to enable "Apply to labels" in matrix (sub)totals?

I'm currently building a JSON theme, and I am having a problem enabling the "Apply to labels"option by default within rowsubtotals and rowtotals in a matrix. I tried a lot of different codes, using the microsoft documentation, forum post and youtube instructions. I learned to use "applyToHeaders": true, but with no effect. Maybe some other part of my code is overwriting it? I hope someone could help me out! 

 

Martijn1_0-1662021412332.png

 

My code:

 

{"name":
"Monitoring",
"dataColors":["#006293","#F9B118","#7C8BA0","#091E3F","#F0FAFF","#F5C869","#77C4A8","#DEA6CF"],
"firstLevelElements": "#091E3F",
"secondLevelElements": "#091E3F",
"thirdLevelElements": "#F3F2F1",
"tableAccent":"#F9B118",
"maximum":"#3257A8",
"center":"#DD6B7F",
"minimum":"#D1DBF1",
"textClasses":{
"label":{
"fontFace":"Nunito Sans",
"color":"#091E3F",
"fontSize":9},
"callout":{
"fontFace":"Nunito Sans",
"color":"#FFFFFF"},
"title":{
"fontFace":"Nunito Sans",
"color":"#091E3F",
"fontSize":11},
"header":{
"fontFace":"Nunito Sans",
"color":"#091E3F"}},
"visualStyles":{
"tableEx": {
"*": {
"general": [{
"responsive": true,
"keepLayerOrder": true
}],
"background": [{
"show": true,
"color": { "solid": { "color": "#FFFFFF"}},
"transparency": 0
}],
"border": [{
"color": { "solid": { "color": "#808080"}},
"show": false,
"radius": 1
}],
"title": [{
"show": true,
"fontColor": { "solid": { "color": "#000000" } },
"background": { "solid": { "color": "#FFFFFF" } },
"alignment": "center"
}],
"grid": [{
"gridVertical": true,
"gridVerticalColor": { "solid": { "color": "#E6E6E6"}},
"gridVerticalWeight": 1,
"gridHorizontal": false,
"gridHorizontalColor": { "solid": { "color": "#E6E6E6"}},
"gridHorizontalWeight": 1,
"rowPadding": 0,
"outlineWeight": 2,
"textSize": 10,
"imageHeight": 100
}],
"columnHeaders": [{
"fontColor": { "solid": { "color": "#FFFFFF"}},
"backColor": { "solid": { "color": "#091E3F"}},
"bold": true,
"outline": "Frame",
"autoSizeColumnWidth": true,
"fontSize": 10,
"wordWrap": true
}],
"values": [{
"fontColorPrimary": { "solid": { "color": "#091E3F"}},
"backColorPrimary": { "solid": { "color": "#FFFFFF"}},
"fontColorSecondary": { "solid": { "color": "#091E3F"}},
"backColorSecondary": { "solid": { "color": "#FFFFFF"}},
"outline": "Frame",
"urlIcon": true,
"wordWrap": true,
"fontSize": 10
}],
"total": [{
"totals": true,
"fontColor": { "solid": { "color": "#FFFFFF"}},
"backColor": { "solid": { "color": "#091E3F"}},
"outline": "Frame",
"fontSize": 10
}],
"stylePreset":[{
"name":"Condensed"
}]
}
},
"clusteredBarChart": {
"*": {
"general": [{
"responsive": true,
"keepLayerOrder": true
}],
"legend": [{
"show": false,
"position": "Top",
"showTitle": true,
"titleText": ""
}],
"categoryAxis": [{
"show": true,
"fontSize": 10,
"position": "Right",
"labelColor": { "solid": { "color": "#091E3F"}},
"preferredCategoryWidth": 30,
"maxMarginFactor": 28,
"innerPadding": 22,
"concatenateLabels": true,
"showAxisTitle": true
}],
"valueAxis": [{
"show": false,
"axisScale": "Linear",
"labelColor": { "solid": { "color": "#01B8AA"}},
"labelDisplayUnits": "0",
"labelPrecision": "Auto",
"showAxisTitle": true,
"axisStyle": "showTitleOnly",
"color": { "solid": { "color": "01B8AA"}},
"titleFontSize": 12,
"fontSize": 10,
"gridlineShow": false,
"gridlineColor": { "solid": { "color": "#01B8AA"}},
"gridlineThickness": 2,
"gridlineStyle": "dashed"
}],
"labels": [{
"show": true,
"color": { "solid": { "color": "#FFFFFF"}},
"labelDisplayUnits": "0",
"fontSize": 8,
"labelPrecision": 1,
"labelPosition": "InsideEnd",
"enableBackground": false,
"backgroundColor": { "solid": { "color": "#0928DD"}},
"backgroundTransparency": 30
}],
"plotArea": [{
"transparency": 20
}]
}
},
"pivotTable": {
"*": {
"general": [{
"responsive": true,
"keepLayerOrder": true
}],
"background": [{
"show": true,
"color": { "solid": { "color": "#FFFFFF"}},
"transparency": 0
}],
"border": [{
"color": { "solid": { "color": "#808080"}},
"show": true,
"radius": 0
}],
"title": [{
"show": true,
"fontColor": { "solid": { "color": "#000000" } },
"background": { "solid": { "color": "#FFFFFF" } },
"alignment": "center"
}],
"stylePreset":[{
"name":"Condensed"
}],
"grid": [{
"gridVertical": true,
"gridVerticalColor": { "solid": { "color": "#E6E6E6"}},
"gridVerticalWeight": 1,
"gridHorizontal": false,
"gridHorizontalColor": { "solid": { "color": "#E6E6E6"}},
"gridHorizontalWeight": 1,
"rowPadding": 0,
"outlineWeight": 2,
"textSize": 10,
"imageHeight": 100
}],
"columnHeaders": [{
"fontColor": { "solid": { "color": "#FFFFFF"}},
"backColor": { "solid": { "color": "#091E3F"}},
"bold": true,
"outline": "Frame",
"fontSize": 10,
"wordWrap": true
}],
"rowHeaders": [{
"fontColor": { "solid": { "color": "#091E3F"}},
"backColor": { "solid": { "color": "#FFFFFF"}},
"outline": "Frame",
"steppedLayoutIndentation": 10,
"urlIcon": false,
"wordWrap": true,
"showExpandCollapseButtons":true
}],
"values": [{
"fontColorPrimary": { "solid": { "color": "#091E3F"}},
"backColorPrimary": { "solid": { "color": "#FFFFFF"}},
"fontColorSecondary": { "solid": { "color": "#091E3F"}},
"backColorSecondary": { "solid": { "color": "#FFFFFF"}},
"outline": "Frame",
"urlIcon": true,
"applyToHeaders": true,
"wordWrap": true,
"fontSize": 10,
"bandedRowHeaders": true
}],
"subTotals": [{
"rowSubtotals": true,
"perRowLevel": true,
"rowSubtotalsPosition": "Top",
"fontColor": { "solid": { "color": "#091E3F"}},
"backColor": { "solid": { "color": "#B0B9C6"}},
"fontSize": 10,
"bold": true,
"applyToHeaders": true
}],
"total": [{
"fontColor": { "solid": { "color": "#FFFFFF"}},
"backColor": { "solid": { "color": "#091E3F"}},
"outline": "Frame",
"fontSize": 10,
"bold": true,
"applyToHeaders": true
}]
}
}
}}

 

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Martijn1 ,

 

I doubt it works, I can't find the "apply to labels" option under subtotals in the matrix theme's template.

PowerBI-ThemeTemplates/Matrix.json at master · deldersveld/PowerBI-ThemeTemplates · GitHub

vkkfmsft_0-1662107948494.png

 

Best Regards,
Winniz

Hi Winniz,

 

Thanks for your reply! I learned in the microsoft documentation that "Apply to labels" in json is "applyToHeaders". 

 

But the structure of the matrix theme template differs from the structure in Power BI Desktop. There isn't one subtotals in PBI desktop, it is split in Row subtotals and Column subtotals. May be that is the problem? I tried "rowSubTotals" in the json theme btw, but didn't work out.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors