Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hey everyone,
we have come to the situation of wanting to rename some columns in our reports for clarity reasons and also replace some raw numbers with measures, so we can add logic to them. However renaming fields breaks the visuals in reports based on the dataset created in the PowerBI service.
Fixing all the visuals by hand is absolutly not feasible for us, as we have hundereds of reports with dozens of visuals each, over multiple datasets. Is there any way to solve this, maybe edit the deployed reports programmatically somehow or are we just stuck with the field naming and layout we chose forever now?
Thanks for any help!
restlessmodem
Solved! Go to Solution.
This should be possible with pbi-tools.
TL;DR from here https://data-goblins.com/power-bi/replace-report-measures
Download pbi-tools desktop CLI and make sure it’s in your path env variables
Decompile your .pbix using pbi-tools extract, referring to the pbix path
In the pbi-tools output, either programmatically or manually replace the field & table references in the broken visuals .json files. For each visual, you must loop through the key/value pairs that refer to tables, fields, or both.
Recompile your .pbix using pbi-tools compile, referring to the path of the pbix output folder
Reopen your .pbix file to confirm that the changes are done.
You may need to do some testing if you have complex visuals with a lot of formatting, to make sure you cover the necessary keys and don’t mistakenly replace other text that you didn’t intend.
Have come across exactly this problem. If you create a column with exactly the same spec as the one to be renamed, but give it the new name you won't break any reports. Then in the cloud you will still have to manually replace the old one (where it is used) with the new one - a manual but safe process!
This should be possible with pbi-tools.
TL;DR from here https://data-goblins.com/power-bi/replace-report-measures
Download pbi-tools desktop CLI and make sure it’s in your path env variables
Decompile your .pbix using pbi-tools extract, referring to the pbix path
In the pbi-tools output, either programmatically or manually replace the field & table references in the broken visuals .json files. For each visual, you must loop through the key/value pairs that refer to tables, fields, or both.
Recompile your .pbix using pbi-tools compile, referring to the path of the pbix output folder
Reopen your .pbix file to confirm that the changes are done.
You may need to do some testing if you have complex visuals with a lot of formatting, to make sure you cover the necessary keys and don’t mistakenly replace other text that you didn’t intend.
We have reviewed the tool and while this will of course not be a simple process, this is exactly what we were looking for as an approach to programmatically alter reports. Thank you!
Awesome! Thank you, this looks very promising! I will try it out and update back here shortly with our findings.
@restlessmodem Well, on a go forward basis you could rename the display names of the columns/measures in new reports in the Visualizations pane. But, if you are trying to rename the columns in the base dataset itself then that is going to break visualizations and I am not aware of a way around that. It's basically the same if somebody changes a column name in a source data system. There will be downstream impacts where this breaks queries, etc.
User | Count |
---|---|
47 | |
31 | |
28 | |
27 | |
26 |
User | Count |
---|---|
58 | |
55 | |
36 | |
33 | |
28 |