Forum Discussion

kwenzelmms's avatar
kwenzelmms
Frequent Visitor
1 year ago
Solved

SEMPY - Remame Column Semantic Model

Hi,   I'm able to generate a semantic model using sempy lab's generate_direct_lake_semantic_model , but once I do that, I would love to rename the colum within the model to "nice" names, as our dat...
  • tharunkumarRTK's avatar
    1 year ago

    kwenzelmms 

    Seems like smepy.update_column cannot change the column name. Not sure if there any other function which can perform this task, But here are a couple of suggestions 

     

    1. with TMSL, you can run this script either from tabular editor or SSMS to update mutiple column names programitically

    {
      "operations": [
        {
          "operationType": "update",
          "object": {
            "database": "YourDatasetName",
            "table": "YourTableName",
            "column": "OldColumnName"
          },
          "property": "name",
          "value": "NewColumnName"
        }
      ]
    }
    

     

    2. first get the definition (bim file) of your semantic model - sempy_labs.get_semantic_model_from_bim
    and then update it with this function sempy_labs.update_semantic_model_from_bim

    https://semantic-link-labs.readthedocs.io/en/stable/sempy_labs.html

     

    Need a Power BI Consultation? Hire me on Upwork

     

     

     

    Connect on LinkedIn

     

     

     








    Did I answer your question? Mark my post as a solution!
    If I helped you, click on the Thumbs Up to give Kudos.

    Proud to be a Super User!