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
Sidhant
Helper II
Helper II

Modifying the Layout files to add new visuals or update properties

Hi everyone,
As we know pbix file is collection of different folders which includes the following:

Sidhant_0-1744264939275.png

And inside the report folder we have the 'Layout' file (which is a type of JSON file) , the structure is something like (the below Layout file represents a Power BI Report that has two pages and three visuals which include a bar chart, pie chart and a card)

Sidhant_1-1744265139135.png

Power BI Report

Sidhant_2-1744265193384.pngSidhant_3-1744265227747.png


So I was experimenting whether we can add few visuals from the layout file or modify few attributes of the existing visual (like the fields, or visual aspects like the position, height, width, etc). So I did try the following steps:
1. Created a backup of my test report and then converted the pbix file to a zip (by renaming the extension from '.pbix' to '.zip')

Sidhant_4-1744265424263.png

2. Then inside te zip file modified one of the visual aspect of the card on page-2  (height and width)

Sidhant_5-1744265502822.jpeg

(Before modifying the height and width the original structure of the card visual)
(To cross check did check in the Power BI report)

Sidhant_6-1744265558200.jpeg



So now I modified the value (height and width) 

Sidhant_7-1744265602079.jpeg

3. Once the changes were made I saved it (to cross check reopened the file the changes were not save even after I overwritten it; So I had to save the modification and save the file as Layout and replace the original one with new one)

4. Then converted the zip back to pbix (even tried with '.pbit') and tried re-opening the report but got 

Sidhant_8-1744265721588.jpeg

And when I checked for some reasons for this issue (one of them was invalid json structure but before savig the same I had also verified the JSON structure on an online tool and it was fine)

So now I had few questions:
i)That can we update the structure of an existing report by modifying the Layout file. 

ii) Is it possible to create a new report if we have the JSON structure: If Yes what are the main components (i.e. mandatory components and which are optional) is there any documentation that can help me in this case
{I did check on Microsoft Co-Pilot about the mandatory components and optional}

  1. Mandatory Components: Each visual in the visualContainers array must have certain mandatory components:
    • config: This contains the visual configuration, including the visual type and data projections.
    • dataTransforms: This includes the data transformations applied to the visual.
    • query: This defines the data query for the visual.
    • position: This specifies the visual's position and size on the report canvas.
  2. Optional Components: Some components are optional but can be included for additional customization:
    • filters: This can be used to apply specific filters to the visual.
    • tabOrder: This defines the tab order for keyboard navigation.


So if anyone has any ideas or work-arounds please let me know (as I was trying to accelerate report creation process through code assuming we have a valid JSON structure)

1 ACCEPTED SOLUTION
Deku
Super User
Super User

This changes are not supported with pbix or bpit format. They are support with power BI projects. Save your file as pbip and you'll have access to the the report.json file which you can modify. The files should have a JSON schema, so you open with Vs code, you should get a indication of what is valid


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

10 REPLIES 10
Deku
Super User
Super User

This changes are not supported with pbix or bpit format. They are support with power BI projects. Save your file as pbip and you'll have access to the the report.json file which you can modify. The files should have a JSON schema, so you open with Vs code, you should get a indication of what is valid


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi @Deku ,
Thanks for the guiding to save the file as pbip instead of pbix, after doing this I got the following structure:

Sidhant_1-1744269597014.png

Inside the 'Report_Name.Report' folder I got the 'json' file (which you mentioned 'Report.json') which was editable in my editor (VS code)

Sidhant_2-1744269693766.png

 



So I tried modifying the height and width of the card visual on Page-2 

Sidhant_3-1744269776928.png

 


(Changed the height and width in the json file-> Saved it), I was expecting the height and width to be updated but the changes weren't reflected.

Sidhant_0-1744269564852.png
(Changes not reflected)

Sidhant_4-1744269883699.png

 



Right now I am trying to modifying the existing visuals but if I want to a new visual (lets a donut chart or a table visual) then how should I start the construction is can you help me with this (is there any article or documentation that can help to add a new visual in a report through json file).

Regards,
Sidhant.



Hi @Deku ,
Just a quick update I was able to modify the size of the card visual just had to modify the width ad height in the config section

Sidhant_5-1744270803778.pngSidhant_6-1744270827768.png

Sidhant_7-1744270856342.png


So now I just want to understand how to add new visuals (and also I have seen a unique id associated with every visual name so how can I figure out the same for other visuals)

Regards,
Sidhant.

With mar release you can right click a visual to copy it's visual id


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi @Deku ,
Didn't get mar release (is it march release) also on right click I could only see copy visual option

Sidhant_0-1744274624143.png

 

Looks like you need to enable the feature in options

 

https://powerbi.microsoft.com/en-us/blog/power-bi-march-2025-feature-summary/#post-29214-_Toc1938198...


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

The changes are only seen if you re open the report. Live changes are not supported yet

 

Can't see any examples online from a quick browse. It is possible. I would turn on git and commit your report. Create a new donut chart or table and look at the git diff to see what changes are applied to your file


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi @Deku ,
So as per your suggestion I created new report wherein I had two pages: In page-1 -> Placed a Donut chart and in Pge-2: Placed a card visual and a table. So my assumption was the name for visuals will remain same in all reports but that was not the case it is different
(New Report)

Sidhant_1-1744275381216.pngSidhant_2-1744275407165.png


(In old report I had two pages: Page-1 -> Barc chart and Pie chart ; Page-2: Card visual)

Sidhant_3-1744275473563.pngSidhant_4-1744275486560.png


So I was expecting as in both visuals I have used a card visual on screen-2 the name for the both visuals might be same but when I checked the respective json it was not the case
New Report (TestPlay.pbip -> JSON)

Sidhant_5-1744275574595.png


Old Report (Demo_to_Test.pbip-> Json)

Sidhant_6-1744275634741.png


So later if I have to add any another visual (there is no fix name associated)

Also in same report I had same visual (with different fields) to see if it also has different name or same name, the answer was different name
(TestPlay.pbip)

Sidhant_7-1744275938335.png

(JSON)
Page-2: Card visual name

Sidhant_8-1744276036286.png


Page-3:

Sidhant_9-1744276068296.png

(Its json)

Sidhant_10-1744276128787.png


And once the visual id is identified then comes the question how to structure the query :

Sidhant_11-1744276219031.png

(I will compare the reports but if there is an easy way that explains on how to structure it it will be helpful)

Regards,
Sidhant.

Hi @Deku ,
So as per your suggestion I created new report wherein I had two pages: In page-1 -> Placed a Donut chart and in Pge-2: Placed a card visual and a table. So my assumption was the name for visuals will remain same in all reports but that was not the case it is different
(New Report)

Sidhant_1-1744275381216.pngSidhant_2-1744275407165.png


(In old report I had two pages: Page-1 -> Barc chart and Pie chart ; Page-2: Card visual)

Sidhant_3-1744275473563.pngSidhant_4-1744275486560.png


So I was expecting as in both visuals I have used a card visual on screen-2 the name for the both visuals might be same but when I checked the respective json it was not the case
New Report (TestPlay.pbip -> JSON)

Sidhant_5-1744275574595.png


Old Report (Demo_to_Test.pbip-> Json)

Sidhant_6-1744275634741.png


So later if I have to add any another visual (there is no fix name associated)

Also in same report I had same visual (with different fields) to see if it also has different name or same name, the answer was different name
(TestPlay.pbip)

Sidhant_7-1744275938335.png

(JSON)
Page-2: Card visual name

Sidhant_8-1744276036286.png


Page-3:

Sidhant_9-1744276068296.png

(Its json)

Sidhant_10-1744276128787.png


And once the visual id is identified then comes the question how to structure the query :

Sidhant_11-1744276219031.png

(I will compare the reports but if there is an easy way that explains on how to structure it it will be helpful)

Regards,
Sidhant.

Hi @Deku ,
Thanks for the link and your prompt response really appreciate it, also I figured out how to add a visual I just copied one of the visual and pasted it below and for unique name just replaced its few end characters and done

Sidhant_0-1744291507317.pngSidhant_1-1744291544490.png


Just wanted to update you on the same

Regards,
Sidhant.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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