Forum Discussion

amcpherson's avatar
amcpherson
Helper I
1 year ago
Solved

Updating Semantic Models in Notebooks with Semantic Link

Hello All,   Is anyone using Semantic Link in notebooks to update Semantic Models? We are working on a template-based reporting structure that is going to be deployed at scale and want to manage up...
  • nilendraFabric's avatar
    1 year ago

    try this


    import sempy.fabric as fabric
    import sempy_labs as labs
    from sempy_labs.tom import connect_semantic_model

     

     


    dataset_name = "YourSemanticModelName"
    model = connect_semantic_model(dataset_name)


    measure = model.tables["YourTable"].measures["YourMeasure"]
    measure.description = "New description"


    model.save_changes()

  • v-veshwara-msft's avatar
    1 year ago

    Hi amcpherson ,

    Thanks for using Microsoft Fabric Community.

    Just checking in to see if you query is resolved and if response from nilendraFabric  was helpful.
    You might also find this related blog post helpful - it walks through a full example of deploying and updating semantic models via Semantic Link in notebooks, along with common issues to avoid:

    Programmatically deploy Semantic Models and Report... - Microsoft Fabric Community

     

    For more background, here’s the official Learn document on Semantic Link:

    What is semantic link? - Microsoft Fabric | Microsoft Learn

    Hope this helps. If any of the responses above resolved your issue, kindly consider marking the helpful reply as Accepted Solution so others can benefit as well.

    Feel free to reach out if you need further assistance.

    Thank you.