Forum Discussion

mbahonen's avatar
mbahonen
Advocate II
3 years ago
Solved

Custom Theme Import Errors

Hello,

I have a theme I built a long time ago that has worked just fine importing into a pbix. However recently I've had trouble importing it into a new pbix file (or existing report). The .json was exported from our current pbit (where its working fine), but when I try to reimport it into either Power BI September 2023 or February 2023 (the versions available to me at my org) I get the below error details that don't seem to help me identify how to fix the "error."  I will add the json to a followup post as it doesn't let me attach the file here. 

 

#/visualStyles/card/*/title/0/alignment must be equal to one of the allowed values (enum: 'left' ,'center' ,'right'; matching schema #/definitions/alignment/enum)
#/visualStyles/card/*/labels/0/labelDisplayUnits must be integer (type; matching schema #/definitions/labelDisplayUnits/type)
#/visualStyles/card/*/labels/0/labelDisplayUnits must be equal to one of the allowed values (enum: '0' ,'1' ,'1000' ,'1000000' ,'1000000000' ,'1000000000000'; matching schema #/definitions/labelDisplayUnits/enum)
#/visualStyles/multiRowCard/*/categoryLabels/0/color/solid/color must match pattern "^#([a-fA-F0-9]{3}){1,2}$" (pattern; matching schema #/definitions/color/pattern)
#/visualStyles/multiRowCard/*/categoryLabels/0/color/solid/color must be object (type; matching schema #/definitions/themeDataColor/type)
#/visualStyles/multiRowCard/*/categoryLabels/0/color/solid/color must match exactly one schema in oneOf (oneOf; matching schema #/oneOf/0/properties/solid/properties/color/oneOf)
#/visualStyles/multiRowCard/*/categoryLabels/0/color must have required property 'gradient' (required; matching schema #/oneOf/1/required)
#/visualStyles/multiRowCard/*/categoryLabels/0/color must NOT have additional properties (additionalProperties; matching schema #/oneOf/1/additionalProperties)
#/visualStyles/multiRowCard/*/categoryLabels/0/color must have required property 'pattern' (required; matching schema #/oneOf/2/required)
#/visualStyles/multiRowCard/*/categoryLabels/0/color must NOT have additional properties (additionalProperties; matching schema #/oneOf/2/additionalProperties)
#/visualStyles/multiRowCard/*/categoryLabels/0/color must match exactly one schema in oneOf (oneOf; matching schema #/oneOf)
#/visualStyles/slicer/*/title/0/alignment must be equal to one of the allowed values (enum: 'left' ,'center' ,'right'; matching schema #/definitions/alignment/enum)
#/visualStyles/slicer/*/header/0/outline must be string (type; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/header/items/properties/outline/type)
#/visualStyles/slicer/*/header/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/header/items/properties/outline/enum)
#/visualStyles/slicer/*/items/0/outline must be string (type; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/items/items/properties/outline/type)
#/visualStyles/slicer/*/items/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/slicer/properties/*/allOf/1/properties/items/items/properties/outline/enum)
#/visualStyles/tableEx/*/values/0/outline must be string (type; matching schema #/properties/visualStyles/properties/tableEx/properties/*/allOf/1/properties/values/items/properties/outline/type)
#/visualStyles/tableEx/*/values/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/tableEx/properties/*/allOf/1/properties/values/items/properties/outline/enum)
#/visualStyles/pivotTable/*/columnHeaders/0/outline must be string (type; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/columnHeaders/items/properties/outline/type)
#/visualStyles/pivotTable/*/columnHeaders/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/columnHeaders/items/properties/outline/enum)
#/visualStyles/pivotTable/*/rowHeaders/0/outline must be string (type; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/rowHeaders/items/properties/outline/type)
#/visualStyles/pivotTable/*/rowHeaders/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/rowHeaders/items/properties/outline/enum)
#/visualStyles/pivotTable/*/values/0/outline must be string (type; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/values/items/properties/outline/type)
#/visualStyles/pivotTable/*/values/0/outline must be equal to one of the allowed values (enum: 'None' ,'BottomOnly' ,'TopOnly' ,'LeftOnly' ,'RightOnly' ,'TopBottom' ,'LeftRight' ,'Frame'; matching schema #/properties/visualStyles/properties/pivotTable/properties/*/allOf/1/properties/values/items/properties/outline/enum)

4 Replies

  • Json File

     

    {
      "name": "Theme 1",
      "dataColors": [
        "#64287D",
        "#FF9657",
        "#9A89D9",
        "#871469",
        "#FFB1A6",
        "#463782",
        "#BB70CC",
        "#B5ADAD",
        "#873100"
       
       
       
      ],
      "bad": "#D71E28",
      "neutral": "#FFCD41",
      "good": "#178757",
      "minimum": "#F9F7F6",
      "center": "#BB70CC",
      "maximum": "#5A1E64",
      "foreground": "#141414",
      "foregroundNeutralSecondary": "#141414",
      "backgroundLight": "#EFE9E1",
      "foregroundNeutralTertiary": "#B5ADAD",
      "backgroundNeutral": "#B5ADAD",
      "firstLevelElements": "#141414",
      "secondLevelElements": "#141414",
      "thirdLevelElements": "#EFE9E1",
      "fourthLevelElements": "#B5ADAD",
      "background": "#FFFFFF",
      "secondaryBackground": "#B5ADAD",
      "tableAccent": "#EFE9E1",
      "textClasses": {
        "title": {
          "fontFace": "'Segoe UI', wf_segoe-ui_normal, helvetica, arial, sans-serif",
          "color": "#141414",
          "fontSize": 10
        },
        "label": {
          "color": "#141414"
        },
        "callout": {
          "fontFace": "'Segoe UI', wf_segoe-ui_normal, helvetica, arial, sans-serif",
          "fontSize": 24
        }
      },
      "visualStyles": {
        "*": {
          "*": {
            "title": [
              {
                "alignment": "Left",
                "background": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 12,
                "show": true
              }
            ],
            "background": [
              {
                "show": false,
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "transparency": 0
              }
            ],
            "border": [
              {
                "color": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "radius": 8,
                "show": false
              }
            ],
            "visualTooltip": [
              {
                "titleFontColor": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "valueFontColor": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "background": {
                  "solid": {
                    "color": "#463782"
                  }
                }
              }
            ],
            "visualHeader": [
              {
                "show": true,
                "showFilterRestatementButton": false,
                "showOptionsMenu": true,
                "showSeeDataLayoutToggleButton": false,
                "showPinButton": true,
                "showDrillDownExpandButton": false,
                "showDrillDownLevelButton": false,
                "showDrillToggleButton": false,
                "showDrillUpButton": false,
                "showDrillRoleSelector": false,
                "showVisualErrorButton": false,
                "showVisualWarningButton": false,
                "showVisualInformationButton": false,
                "showTooltipButton": false,
                "showFocusmodeButton": true
              }
            ]
          }
        },
        "page": {
          "*": {
            "background": [
              {
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "transparency": 50
              }
            ],
            "outspace": [
              {
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                }
              }
            ]
          }
        },
        "slicer": {
          "*": {
            "title": [
              {
                "show": true,
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "background": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "alignment": "Left",
                "fontSize": 10,
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal"
              }
            ],
            "background": [
              {
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "transparency": 0,
                "show": true
              }
            ],
            "header": [
              {
                "show": true,
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "background": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "outline": 0,
                "textSize": 10,
                "fontFamily": "Segoe UI"
              }
            ],
            "items": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "background": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "outline": 0,
                "textSize": 10,
                "fontFamily": "Segoe UI"
              }
            ],
            "border": [
              {
                "show": false,
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                }
              }
            ],
            "selection": [
              {
                "singleSelect": false,
                "multiSelect": true,
                "selectAllCheckboxEnabled": true
              }
            ]
          }
        },
        "card": {
          "*": {
            "title": [
              {
                "show": false,
                "alignment": "Left",
                "fontSize": 12,
                "background": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal"
              }
            ],
            "labels": [
              {
                "color": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "labelDisplayUnits": "0",
                "labelPrecision": 0,
                "fontSize": 24,
                "fontFamily": "'wf_segoe-ui_bold', Segoe UI"
              }
            ],
            "categoryLabels": [
              {
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 14,
                "color": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "show": true
              }
            ],
            "background": [
              {
                "show": true,
                "color": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "transparency": 0
              }
            ],
            "border": [
              {
                "show": true,
                "color": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                }
              }
            ]
          }
        },
        "multiRowCard": {
          "*": {
            "dataLabels": [
              {
                "fontFamily": "'wf_segoe-ui_bold', Segoe UI",
                "fontSize": 16,
                "color": {
                  "solid": {
                    "color": "#141414"
                  }
                }
              }
            ],
            "categoryLabels": [
              {
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 12,
                "color": {
                  "solid": {
                    "color": " #141414"
                  }
                }
              }
            ],
            "border": [
              {
                "show": true,
                "color": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                }
              }
            ]
          }
        },
        "tableEx": {
          "*": {
            "grid": [
              {
                "outlineColor": {
                  "solid": {
                    "color": "#64287D"
                  }
                },
                "gridVertical": true,
                "gridVerticalColor": {
                  "solid": {
                    "color": "#ffffff"
                  }
                },
                "gridHorizontal": true,
                "gridHorizontalColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                }
              }
            ],
            "columnHeaders": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColor": {
                  "solid": {
                    "color": "#ffffff"
                  }
                },
                "borderColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "autoSizeColumnWidth": false,
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 10
              }
            ],
            "values": [
              {
                "fontColorPrimary": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColorPrimary": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "fontColorSecondary": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColorSecondary": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "bandedRowHeaders": false,
                "valuesOnRow": true,
                "outline": 15,
                "urlIcon": true,
                "wordWrap": true,
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 10
              }
            ]
          }
        },
        "pivotTable": {
          "*": {
            "stylePreset": [
              {
                "name": "Condensed"
              }
            ],
            "grid": [
              {
                "gridVertical": true,
                "gridVerticalColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "gridVerticalWeight": 1,
                "gridHorizontal": true,
                "gridHorizontalColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "gridHorizontalWeight": 1,
                "rowPadding": 1,
                "outlineColor": {
                  "solid": {
                    "color": "#64287D"
                  }
                },
                "outlineWeight": 1,
                "textSize": 10,
                "imageHeight": 100
              }
            ],
            "columnHeaders": [
              {
                "alignment": "Left",
                "autoSizeColumnWidth": true,
                "backColor": {
                  "solid": {
                    "color": "#ffffff"
                  }
                },
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 10,
                "outline": 15,
                "titleAlignment": "Left",
                "urlIcon": true,
                "wordWrap": true
              }
            ],
            "rowHeaders": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColor": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "outline": 15,
                "stepped": true,
                "steppedLayoutIndentation": 12,
                "urlIcon": true,
                "wordWrap": true,
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 10,
                "alignment": "Left",
                "showExpandCollapseButtons": true
              }
            ],
            "values": [
              {
                "backColorPrimary": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "backColorSecondary": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "bandedRowHeaders": true,
                "fontColorPrimary": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontColorSecondary": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "fontSize": 10,
                "outline": 15,
                "urlIcon": true,
                "valuesOnRow": true,
                "wordWrap": true
              }
            ],
            "subTotals": [
              {
                "rowSubtotals": true,
                "columnSubtotals": true,
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "backColor": {
                  "solid": {
                    "color": "#FFFFFF"
                  }
                },
                "fontSize": 10,
                "applyToHeaders": true,
                "rowSubtotalsPosition": "Top",
                "perRowLevel": true,
                "perColumnLevel": true
              }
            ],
            "total": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "fontFamily": "'Segoe UI', wf_segoe-ui_normal",
                "backColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "applyToHeaders": true,
                "fontSize": 10
              }
            ],
            "rowTotal": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "applyToHeaders": true,
                "fontSize": 10,
                "outline": "Top only",
                "outlineColor": {
                  "solid": {
                    "color": "#141414"
                  }
                }
              }
            ],
            "columnTotal": [
              {
                "fontColor": {
                  "solid": {
                    "color": "#141414"
                  }
                },
                "backColor": {
                  "solid": {
                    "color": "#F4F0ED"
                  }
                },
                "applyToHeaders": false,
                "fontSize": 10
              }
            ]
          }
        }
      }
    }
  • Hi mbahonen ,

     

    It seems that the criteria has been changed since February 2023.

    You can try to rollback your desktop version or modify your json file.

    Here's a method to figure out errors.

     

    For more details, please refer to:

    powerbi-desktop-samples/Report Theme JSON Schema at main · microsoft/powerbi-desktop-samples · GitHub 

    Solved: Re: Custom themes are broken - Microsoft Fabric Community  

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • mbahonen's avatar
      mbahonen
      Advocate II

      Thanks for that information. Unfortunately I don't have the option to rollback the desktop version since its controlled by the enterprise. I'll see if I can modify though. 

    • mbahonen's avatar
      mbahonen
      Advocate II

      Thanks again! I was able to update my file by correcting the errors and adding the correct schema name to the json file.