How to Disable Custom Visual in Power BI Desktop Model

Custom visuals are awesome. It’s easy to import them to Power BI Desktop model and start using them. But, what if you decide to remove them from your model? Is there a way to disable an imported custom visual?

Well, the answer is No and Yes! I mean, NO, there is no specific setting or option you can manage imported custom visuals in Power BI Desktop. But, YES, there is a way you can get rid of an existing custom visual. In this article I show you how to do the job.

First of all, I’d like to inform you that Microsoft will add the feature to disable custom visuals in Power BI Desktop, but, until then you can follow the my trick to completely disable/remove a custom visual from your Power BI Desktop model.

As you might already know a PBIX file is a compressed file indeed, so you can open it with a ZIP editor software like 7-Zip.

Requirements:

  • Download and install 7-Zip. It’s a free open source file archiver/compressor
  • Download and install Notepad++ which is also free and open source. It’s an awesome text editor

Removing/disabling Custom Visual

  • Open you Power BI Desktop model (PBIX file) containing a custom visual
  • As you see you need to enable custom visuals, click “Enable custom visuals”

Enable Custom Vizuals

  • I used “KPIStatusWithHistory” custom visual in my sample model

Custom Vizuals

  • As a new KPI visual released by Microsoft I don’t need the custom visual anymore. So I replace the “KPIStatusWithHistory” with the “KPI” visual.

KPI Vizual

  • In your case you might want to do the same or you might want to completely remove the custom visual from your model
  • Save the model after making the corresponding changes
  • Close Power BI Desktop
  • Reopen the PBIX file
  • As you see you although you replaced/removed the custom visual you still get the “Enable custom visual” warning message on top of the report

Enable Custom Vizuals Warning

  • The reason for that is that Power BI Desktop imports the custom visuals to the model, so although we replaced the custom visual with a default visual, we still get the warning message on top of the report. So we need to remove the custom visual from the model
  • Close Power BI Desktop
  • Browse the folder containing the PBIX file
  • Right click the PBIX file
  • Click 7-Zip –> Open archive to open the PBIX in 7-Zip

Open PBIX in 7-Zip

  • Double click “Report” folder
  • Right click on “CustomVisuals” folder then delete

Edit PBIX in 7-Zip

  • Now double click on “Layout” file to open it
  • Windows will ask you how to open the file you select Notepad++

Edit Layout in Notepad++

  • On Notepad++ click “View” menu then tick “Word wrap” to see the file content tidier

Edit Layout in Notepad++ 2

  • Press “Ctrl + F” to open “Find”
  • Search for ,”resourcepackages” without RED quotation marks

Edit Layout in Notepad++ 3

  • Select ,”resourcePackages”:[ and whole text after it down to close bracket. If you use Notepad++ it’s easy to find the close bracket as it highlights it. You can also search for ,”sections”: and you can find the close bracket right before it. 

Modifying Layout Scripts

  • Delete the selected text
  • “Save as” the “Layout” file in your local drive
  • Remember that the “layout” file doesn’t have any file extension. So if Notepad++ added a default text file extension when saving  remember to remove it
  • Now drag and drop the file to 7-Zip and replace the existing “Layout” file with the new one

Replace Layout

  • Close 7-Zip
  • Open the PBIX file

Disable Custom Visual

As you can see we successfully removed the custom visual from the visualisations. We also got rid of the “Enable custom visual” warning message on top of the report.

Note: You might think of changing the file extension from PBIX to ZIP then open the file normally in Window Explorer. It would be OK for the first part of the job explained so far, but, you might corrupt the file if when replacing “Layout” when browsing the ZIP file with Windows Explorer.

Note: I used 7-Zip and Notepad++ and it worked. I’m not sure if all other software like WinZip or WinRar can do the job.

Leave a Reply