Forum Discussion

sergprim's avatar
sergprim
Frequent Visitor
1 year ago
Solved

Semantic model. Alter relationship with TMSL

Have a alrge model, take 2 days to load data. Need to modify relationships

Tried numerous way stil cann not make it work
Any thoughts?

{
  "alter": {
    "object": {
      "database": "myDB",
      "relationships": "AutoDetected_myGUID"
    },
    "relationships": {
            "name": "AutoDetected_myGUID",
            "fromTable": "from table Name",
            "fromColumn": "from column name",
            "toTable": "to table Namet",
            "toColumn": "to column name",
            "crossFilteringBehavior": "bothDirections"
     }
}
}

6 Replies

  • Hi sergprim 

     

    Why note use Tabular Editor to alter the relationship and save it back to the Semantic Model?

     

    Remember after altering the relationship you will have to refresh the semantic model so that the relationship can be created to the tables.

  • v-menakakota's avatar
    v-menakakota
    Community Support

    Hi sergprim ,
    Thanks for reaching out to the Microsoft fabric community forum.

    I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

    • v-menakakota's avatar
      v-menakakota
      Community Support

      Hi sergprim ,

      As mentioned by GilbertQ  Since modifying relationships directly via TMSL can sometimes be tricky especially in complex modelsit might be easier and more reliable to use Tabular Editor for this task.
      I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you

      Thank you.

  • sergprim's avatar
    sergprim
    Frequent Visitor

    Goal is to develop a script you can send to support team and they will execute it using PowerShell or Power app

     

    • v-menakakota's avatar
      v-menakakota
      Community Support

      Hi sergprim ,

      Since your intention is to develop a TMSL script that the support team can run , the recommended approach would be to raise a support ticket with the required details including the updated relationship structure and the context for the change.

      Please refer below link on how to raise a contact support or support ticket. 
      How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn 

      Regards,
      Community Support Team

      • v-menakakota's avatar
        v-menakakota
        Community Support

        Hi sergprim ,

        We’d like to follow up on your support ticket. Has the issue been successfully addressed?

        If a solution was provided, we’d truly appreciate it if you could share your experience or any relevant details, your input could be valuable to other community members.

         

        Thanks again for being an active part of the Microsoft Fabric Community!