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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
TBardien
Helper I
Helper I

Dataset relationships through the API

How do I get the Dataset relationships through the API?

 

So, I am trying to call "client.Datasets.PostDatasetInGroupAsync(Guid groupId, CreateDatasetRequest dataset)

I have the groupID, so I am trying to create the "CreateDatasetRequest dataset".

"CreateDatasetRequest " is a class that looks like this:

public string Name { get; set; }
public IList<Table> Tables { get; set; }
                      public IList<Relationship> Relationships { get; set; }
                   public IList<Datasource> Datasources { get; set; }
              public DatasetMode? DefaultMode { get; set; }

 

I need the Tables, the Relationships and the Datasources.

My dataset is basically a copy of another dataset, and I am getting the information from the copied datasource.

I can get Tables like this: client.Datasets.GetTablesInGroupAsync(workspaceId, datasetID);

NOTE: client.Datasets.GetTablesInGroupAsync(workspaceId, datasetID); does not seem to work. it throws a NOT FOUND ERROR.

and the datasource like this: client.Datasets.GetDatasourcesInGroupAsync(workspaceId, datasetID);

 

But I cannot find a way to get the Relationships.

Is there a way that I can do this?

1 REPLY 1
lbendlin
Super User
Super User

Connect to the XMLA endpoint and run your XMLA scripts aganst the DMVs.  Use DAX Studio or similar to experiment with that.

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.