Forum Discussion
Possible to programmatically or dynamically change column names (ie: different language)
- 8 years ago
Hi Dale,
Are you a Microsoft employee? Or have a direct line of contact?
I feel quite certain this very simple approach would provide a workable solution with very little implementation cost, could you try to pass it along? (I also added it to the idea you linked, thanks for pointing that out).
Ruth points out here that it appears that the physical column names (as opposed to an id or guid) are what's used to bind the model to visuals: https://www.youtube.com/watch?v=JJryD2dXVVw
Changing this to instead bind on an id (and store the textual name elsewhere) seems like it could be an incredibly difficult change as it would be very deep in the core of Power BI. But what about this approach.....as we know, we can already change table and column names in the Power BI user interface and it works just fine. All that implementation works perfectly well. So, rather than making deep fundamental changes to bind on id's, why not just provide a simple API **to the very same code that the existing Power BI user interface calls today**? Would everything not then work exactly as it does today when a user manually calls it by right clicking and doing a rename?
Example:
var powerBI = new PowerBIApplication();
var myModel = powerBI.OpenModel("c:\users\Jimbo\Desktop\AwesomeModel.pbix");
myModel.RenameTable("OldTableName", "NewTableName");
myModel.RenameColumn("NewTableName", "OldColumnName", "NewColumnName");
myModel.Save();
myModel.Close();
I can't think of a good reason why that wouldn't work.....am I overlooking something?
Thank you!