Forum Discussion

TeeGee's avatar
TeeGee
Helper II
8 years ago
Solved

Possible to programmatically or dynamically change column names (ie: different language)

From my reading on the topic so far, there is currently no way in Power BI to handle a requirement to release versions of a pbix file with the table and column names in the model translated to a different language.  The closest approach I've come across is a means of making the column names dynamic, but this then breaks any visuals that were created using the prior names.

 

Unless I'm mistaken (am I???), this seems like a very large shortcoming in the product and I'd think would justify a feature request.

 

Does anyone happen to know the definitive state of affairs on this?

2 Replies

    • TeeGee's avatar
      TeeGee
      Helper II

      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!