The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!
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
}]
}
}
}}
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
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.