cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MWinter225 Regular Visitor
Regular Visitor

Custom Report Theme JSON Property settings in Tables/Matrix

Hi,

 

Has anyone had any luck controling the huge list of properties in report theme announcement? 

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-report-themes/#report-theme-json-f...

 

I am testing this and just trying to turn on Vertical and Horizontal Gridlines and change their default color. If I could do this, I'm thinking that I'll be in a good place to continue on customizing other properties. 

 

I am fairly new to working with JSON so hopefully there is something obviously wrong with this and a simple fix.  This is my simplified JSON just trying to set custom colors and then turn on horizontal and vertical grid lines and choose the default colors for them:

 

{  
   "name":"TestTheme",
   "dataColors":[  
      "#0069aa",
      "#4f8dc2",
      "#9ab7da",
      "#cedaec",
      "#00c762",
      "#fbe7a6",
      "#ff544a",
      "#f89a1c",
      "#545451"
   ],
   "visualStyles":{  
      "pivotTable":{  
         "*":{  
            
            "grid":[  
               {  
                  "gridVertical":true,
                  "gridVerticalColor":"#4f8dc2",
                  "gridHorizontal":true,
                  "gridHorizontalColor":"#4f8dc2"
               }
            ]
         }
      }
   }
}

What am I doing wrong?  Any Ideas @Ashish_Mathur, @Greg_Deckler@TomMartens, @v-yulgu-msft@Seth_C_Bauer? Calling on the big guns! 

 

Thanks in advance, 

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
MWinter225 Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Property settings in Tables/Matrix

Hey Everyone, 

 

Microsoft has gotten back with me and said 

 

"Our product team have fixed this issue and code check-in has been done.

Product team confirmed that this fix will be available in the service in about 3 weeks and this fix will be available in December version of Power BI Desktop."

 

Looks like most or all of the properties that don't work now will work in the December release! ....To Be Continued...

 

10/25 update:

I got another response back-

 

My product team confirmed that the JSON file that you have developed is correct. They have fixed bugs in Power BI Desktop which rendered properly based on the JSON file." 

 

looks like we can take my original example as correct as far as the properties of the "grid" card are concerned. Here's to changing more properties by JSON theme files in December! Smiley Very Happy

 

11/1  Update:

 

OK so the Microsoft team told me specifically that the only issues that will be fixed are the ones that are brought to their team via support tickets. So if you see something that doesn't work SEND IT IN! They said in order to keep track of what needs fixing they will only fix issues brought to their attention. I already sent in all the ones that don't work for my use case but that will not cover all the other JSON properties not working. Someone needs to do a giant test of all the properties and then send in a huge ticket Smiley LOL

 

12/12 Update:

 

The December release is out and as far as I can tell, there has been no changes as far as the JSON features working.  I reached out to the MS team to troubleshoot. hopefully its user error and I just need to change my JSON. Smiley Mad

 

Jan 2018 Update:

Apparently the JSON features I requested to be fixed WERE fixed but they weren't working the way they originally told me they would! This works for me and fulfills my requirements for my original post:

{  
   "name":"Jan 2018 Theme",
   "dataColors":[  
      "#0069aa",
      "#4f8dc2",
      "#9ab7da",
      "#cedaec",
      "#00c762",
      "#fbe7a6",
      "#ff544a",
      "#f89a1c",
      "#545451"
   ],
   "background":"#FFFFFF",
   "foreground":"#545451",
   "tableAccent":"#4f8dc2",
   "visualStyles":{  
      "*":{  
         "*":{  
            "*":[  
               {  
                  "fontFamily":"Segoe UI"
               }
            ]
         }
      },
	  "*":{  
            "*":{
               "grid":[
                  {  
                     "outlineColor":{"solid":{"color":"#4f8dc2"}},
                     "gridVertical":true,
                     "gridVerticalColor":{"solid":{"color":"#4f8dc2"}},
                     "gridHorizontal":true,
                     "gridHorizontalColor":{"solid":{"color":"#4f8dc2"}}
                  }
               ],
               "columnHeaders":[  
                  {  
                     "fontColor":{"solid":{"color":"#ffffff"}},
                     "backColor":{"solid":{"color":"#0069aa"}},
                     "fontFamily":"Segoe UI"
                  }
               ],
               "values":[  
                  {  
                     "backColorSecondary":{"solid":{"color":"#cedaec"}}
                  }
               ]
            }
         }
   }
}

 

 

31 REPLIES 31
ctappan Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

This might help get you going, though I'm newish to json too and haven't been able to run with it like I'd like to:

https://powerbi.tips/tools/report-theme-generator-v3/

 

As another start, I think maybe there should be one more layer of "*" in your json before "pivotTable":

{  
   "name":"TestTheme",
   "dataColors":[  
      "#0069aa",
      "#4f8dc2",
      "#9ab7da",
      "#cedaec",
      "#00c762",
      "#fbe7a6",
      "#ff544a",
      "#f89a1c",
      "#545451"
   ],
   "visualStyles":{  
      "*":{
		  "pivotTable":{  
			 "*":{  
				"grid":[  
				   {  
					  "gridVertical":true,
					  "gridVerticalColor":"#4f8dc2",
					  "gridHorizontal":true,
					  "gridHorizontalColor":"#4f8dc2"
				   }
				]
			 }
		  }
	   }
	}
}

 

 

 

ctappan Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

This might help get you going, though I'm newish to json too and haven't been able to run with it like I'd like to:

https://powerbi.tips/tools/report-theme-generator-v3/

 

As another start, I think maybe there should be one more layer of "*" in your json before "pivotTable":

 

{  
   "name":"TestTheme",
   "dataColors":[  
      "#0069aa",
      "#4f8dc2",
      "#9ab7da",
      "#cedaec",
      "#00c762",
      "#fbe7a6",
      "#ff544a",
      "#f89a1c",
      "#545451"
   ],
   "visualStyles":{  
      "*":{
		  "pivotTable":{  
			 "*":{  
				"grid":[  
				   {  
					  "gridVertical":true,
					  "gridVerticalColor":"#4f8dc2",
					  "gridHorizontal":true,
					  "gridHorizontalColor":"#4f8dc2"
				   }
				]
			 }
		  }
	   }
	}
}

 

 

 

 

ctappan Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

I was wrong--it was just your json. get rid of the double line break before "grid" and it works.

 

ctappan Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

I was wrong again.

 

Fixing the json allowed the theme to be imported without error, but it doesn't do anything other than change the color palette.

 

The link I referenced earlier seems to have effect on the column chart but not the bar chart; I'm able to affect the slicer but can't get the grid properties you referenced to work.

 

Some of the announcement page almost makes it sound like it's still being developed, but it's hard for me to imagine that much documentation before it went live...

MWinter225 Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

Thanks for your reply. I agree, I wish the documentation was a bit more thorough. Hoping to find an answer to this here!

KellyDittmar Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

I just arrived hopeful for brilliance related to this topic... but alas, I'm with you.

 

The only thing that seems to work is the color setup. None of the other formatting in the visualStyles area has any impact on my reports. 

 

The thing I thought to check was the version of Power BI desktop I'm using - which is sept, so this should work... but that's burned me before! 

 

Kelly

MWinter225 Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

@KellyDittmar

In my testing, I've been able to change general properties like responsive visuals, font families, text sizes, and text colors only when it applies to all items in a report. I've also been able to do some more card-level property changes like legend position, data lables and such.  This tool helped me a lot to figure out the inner workings of a JSON theme file(https://powerbi.tips/tools/report-theme-generator-v3/), but it seems like no matter how many different ways I test it, I can't get any of the other properties to work. Right now I'm just focusing on the Matrix (pivotTable) because thats what my requirements are, so things like changing the column header background color/text color, alternating row background color, outline color, and vertical/horizontal grid switched on with a specific color would be great! I'll post if I figure it out, but it seems like it doesn't work yet.  

 

any thoughts @norahfox? I saw you had some insight on another json color setting related question.

ctappan Regular Visitor
Regular Visitor

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

I can relate--when my email says there's a response I get excited, only to be disappointed they're asking questions too.

 

As Mwinter noted a minute ago, something like the code below will change general settings. I'm fairly confident that I successfully set some card-level properties as well, but most failed.

 

{
	"name": "myTheme",
	"dataColors": ["#E2A227", "#593224", "#2F9570", "#BA692D", "#BC9934", "#912731", "#717430", "#89431E"],
	"background": "#FFFFFF",
	"foreground": "#89431E",
	"tableAccent": "#89431E",
	"visualStyles": {
		"*": {
			"*": {
				"*": [
					{
						"fontSize": 9,
						"fontFamily": "Trebuchet MS",
						"color": {
							"solid": {
								"color": "#89431E"
							}
						}
					}
				]
			}
		}
	}
}
Super User
Super User

Re: Custom Report Theme JSON Enumeration settings in Tables/Matrix

@ctappan@MWinter225@KellyDittmar Hey all, looping in the owner of the color theme generator (Mike Carlo) to see if he can provide any insight, and maybe encorporate any new ideas you may have into the tool. @Mike_Carlo

Near SE WI? Join our PUG Milwaukee Brew City PUG