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 updates programmatically using semantic link. I keep running into an error on the write however that seems to be endpoint related. Any guidance would be appreciated.

 

Thanks!

  • 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()

  • 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.

4 Replies

  • 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
    v-veshwara-msft
    Community Support

    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.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi amcpherson ,

    Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.

    If you're still facing issues, feel free to reach out.

    Thank you.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi amcpherson 

    We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the Accepted Solution to assist others facing similar challenges.

    If you still need assistance, please let us know.
    Thank you.