In part 1 of this series, we used DAX – scripting to bulk-copy measures. The next step is to bulk-copy pages with the new logic. To do this we can use the Power BI PBIP functionality and note ++.
In our situation we added two (2) new fact tables to the model with an additional nine (9) measures. We have already created a report, with our old fact table included, and we would now like to have the same pages with our new fact tables. It is not efficient to duplicate every page and manual change every measure and field. This will take a lot of time …

If we save our project as a PBIP file, Power BI will save the file as a project structure. This project structure has a JSON file called report.json. This file contains the metadata (background data) of the Power BI report. This means report, pages, visual containers etc. By opening this file with a JSON reader, for example note ++, we have the ability to change this file and therefore our report to our liking.
Start
• Once we have followed the steps of part 1, we can save our PBIX semantic model as a PBIP (project) file. Make sure that it’s saved in a convenient place (folder) because Power BI will save it as two (2) folders and a PBIP semantic model.

• Download note ++ and open the file report.json which will be stored in the .report folder of the PBIT save.
Note++ will now show an overview of the Power BI metadata of the report.
Note++
• The sections Pods and/ or ResourcePackages can be closed. These sections are not necessary for our task. What will be left is the section, sections. Every page has its own section and will start with config and displayname, which will state the name of page. If sections are kept open, but the underlying sections are closed, the number of pages that are already in the report can be counted. The overview should look as follows:

• To copy a page find the parenthesis ( { ) that belongs to the page. Select both the current row and the row below, this will make sure the entire section will be copied.

• Press CTRL + C.
• Open the section parenthesis ( { ) at the bottom. This will be the latest section before the angle bracket ( ] ).
• Place a comma ( , ) after the final closing parenthesis ( } ).
• Press enter to create a blank row and copy paste (CTRL + V)
• Delete the double parenthesis ( } ) and comma ( , ) to make sure the section can be properly closed.

• Select your inserted section and with CTRL + H, replace the values (replace all). The same way as described in part 1.

• Do a final check in your section to see if you see any abnormalities.
• Save your note++ file.
The report.json file has now been updated with the newly added page. Because of the replace-values it should now have all the new tables and measures.
PBIP / PBIX
• In the project structure is a pbip. file saved. This file contains the newly updated logic. Open this file and do a check to see if everything worked out the way it should.

Please be aware! Because of the copy and pasting of the section, the section ID has also been copied. This is the unique code that Power BI uses to distinguish a page. The final step is to copy the newly created page in the Power BI report and to delete the old one. This resets the section ID.

