Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
UmeshGoti
Helper I
Helper I

Need to establish relation between tables in create semantic API for PowerBi Service

Currently i am able to create semantic layer through fabric API
(https://learn.microsoft.com/en-us/rest/api/fabric/semanticmodel/items/create-semantic-model?tabs=HTT...)

In above API i am passing request body which can contain multiple tables definition(in Base64 Format) but currently i am unable to provide relationships among those tables.

can someone please help on how to provide relationships among provided tables in request body in create semantic API

Thanks in advance !!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @UmeshGoti ,

Please try to include the relationships in your JSON request body to establish relationships between tables in the semantic model for Power BI Service using the Fabric API, later check if it can work or not:

  "relationships": [
      {
        "name": "Relationship1",
        "fromTable": "Claim_asof_fact",
        "fromColumn": "OPEN_CLAIM_COUNT",
        "toTable": "Claim_asof_fact2",
        "toColumn": "OPEN_CLAIM_COUNT",
        "crossFilteringBehavior": "oneDirection",
        "relationshipType": "regular"
      }
    ]

Best Regards

View solution in original post

2 REPLIES 2
UmeshGoti
Helper I
Helper I

here is sample JSON with two tables
{
"name": "SalesModel1",
"compatibilityLevel": 1550,
"model": {
"culture": "en-US",
"dataAccessOptions": {
"legacyRedirects": true,
"returnErrorValuesAsNull": true
},
"defaultPowerBIDataSourceVersion": "powerBI_V3",
"sourceQueryCulture": "en-US",
"tables": [
{
"name": "Claim_asof_fact",
"lineageTag": "eaf4ab7c-3bdd-437c-bd9d-8d6f1de2eb12",
"columns": [
{
"name": "OPEN_CLAIM_COUNT",
"dataType": "Int64",
"isNullable": false,
"sourceColumn": "OPEN_CLAIM_COUNT",
"sourceProviderType": "int",
"lineageTag": "4e475557-0a24-43ff-b93e-e7a75fd3895c",
"summarizeBy": "none",
"annotations": [
{
"name": "SummarizationSetBy",
"value": "Automatic"
}
]
}
],
"partitions": [
{
"name": "Applications",
"mode": "directQuery",
"source": {
"type": "m"
}
}
],
"annotations": [
{
"name": "PBI_ResultType",
"value": "Table"
}
]
},
{
"name": "Claim_asof_fact2",
"lineageTag": "eaf4ab7c-3bdd-437c-bd9d-8d6f1de2eb12",
"columns": [
{
"name": "OPEN_CLAIM_COUNT",
"dataType": "Int64",
"isNullable": false,
"sourceColumn": "OPEN_CLAIM_COUNT",
"sourceProviderType": "int",
"lineageTag": "4e475557-0a24-43ff-b93e-e7a75fd3895n",
"summarizeBy": "none",
"annotations": [
{
"name": "SummarizationSetBy",
"value": "Automatic"
}
]
}
],
"partitions": [
{
"name": "Applications",
"mode": "directQuery",
"source": {
"type": "m"
}
}
],
"annotations": [
{
"name": "PBI_ResultType",
"value": "Table"
}
]
}
],
"cultures": [
{
"name": "en-US",
"linguisticMetadata": {
"content": {
"Version": "1.0.0",
"Language": "en-US"
},
"contentType": "json"
}
}
],
"annotations": [
{
"name": "PBI_QueryOrder",
"value": "[\"Applications\"]"
},
{
"name": "__PBI_TimeIntelligenceEnabled",
"value": "1"
},
{
"name": "PBIDesktopVersion",
"value": "2.137.1102.0 (24.10)"
},
{
"name": "PBI_ProTooling",
"value": "[\"DevMode\"]"
},
{
"name": "TabularEditor_SerializeOptions",
"value": "{\"IgnoreInferredObjects\":true,\"IgnoreInferredProperties\":true,\"IgnoreTimestamps\":true,\"SplitMultilineStrings\":true,\"PrefixFilenames\":false,\"LocalTranslations\":false,\"LocalPerspectives\":false,\"LocalRelationships\":false,\"Levels\":[\"Data Sources\",\"Shared Expressions\",\"Perspectives\",\"Relationships\",\"Roles\",\"Tables\",\"Tables/Columns\",\"Tables/Hierarchies\",\"Tables/Measures\",\"Tables/Partitions\",\"Tables/Calculation Items\",\"Translations\"]}"
},
{
"name": "__TEdtr",
"value": "1"
}
]
}
}

Anonymous
Not applicable

Hi @UmeshGoti ,

Please try to include the relationships in your JSON request body to establish relationships between tables in the semantic model for Power BI Service using the Fabric API, later check if it can work or not:

  "relationships": [
      {
        "name": "Relationship1",
        "fromTable": "Claim_asof_fact",
        "fromColumn": "OPEN_CLAIM_COUNT",
        "toTable": "Claim_asof_fact2",
        "toColumn": "OPEN_CLAIM_COUNT",
        "crossFilteringBehavior": "oneDirection",
        "relationshipType": "regular"
      }
    ]

Best Regards

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.