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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
marcio_fornari
Resolver I
Resolver I

Get Relathionships from Power BI REST API executeQuery

Hello,I used to have this DAX code that I executed on the endpoint to retrieve dataset relationships, but now Microsoft seems to have blocked the execution of queries with INFO.*. Is there another way to get the relationships without using the INFO functions?

My querie:

DEFINE 
    VAR _Table = 
        SELECTCOLUMNS(
            INFO.TABLES(),
            "TableID", [ID],
            "TableName", [Name]
        )
    VAR _Col = 
        SELECTCOLUMNS(
            INFO.COLUMNS(),
            "ColumnID", [ID],
            "ColumnName", 
                IF(
                    ISBLANK([ExplicitName]), 
                    [InferredName], 
                    [ExplicitName]
                )
        )
    VAR _RelFrom = 
        SELECTCOLUMNS(
            INFO.RELATIONSHIPS(),
            [ID],
            [FromCardinality],
            [IsActive],
            [CrossFilteringBehavior],
            [SecurityFilteringBehavior],
            "ColumnID", [FromColumnID],
            "TableID", [FromTableID]
        )
    VAR _RelTo = 
        SELECTCOLUMNS(
            INFO.RELATIONSHIPS(),
            [ID],
            [ToCardinality],
            [CrossFilteringBehavior],
            "ColumnID", [ToColumnID],
            "TableID", [ToTableID]
        )
    VAR _FromRel = 
        SELECTCOLUMNS(
            NATURALLEFTOUTERJOIN(
                NATURALLEFTOUTERJOIN(_RelFrom, _Table), 
                _Col
            ),
            [ID],
            [IsActive],
            "From Table", [TableName],
            "From Column", [ColumnName],
            "From Cardinality", 
                SWITCH(
                    [FromCardinality],
                    1, "One",
                    2, "Many",
                    "Something else"
                )
        )
    VAR _ToRel = 
        SELECTCOLUMNS(
            NATURALLEFTOUTERJOIN(
                NATURALLEFTOUTERJOIN(_RelTo, _Table), 
                _Col
            ),
            [ID],
            "To Table", [TableName],
            "To Column", [ColumnName],
            "To Cardinality", 
                SWITCH(
                    [ToCardinality],
                    1, "One",
                    2, "Many",
                    "Something else"
                )
        )
    VAR _Result = 
        SELECTCOLUMNS(
            NATURALLEFTOUTERJOIN(_FromRel, _ToRel),
            "From Table", [From Table],
            "From Column", [From Column],
            "To Table", [To Table],
            "To Column", [To Column],
            "Cardinality (From/To)", 
                UPPER([From Cardinality]) & " row" & 
                IF([From Cardinality] = "One", "", "s") & 
                " in '" & [From Table] & "'[" & [From Column] & "]" & 
                " matches to " & 
                UPPER([To Cardinality]) & " row" & 
                IF([To Cardinality] = "One", "", "s") & 
                " in '" & [To Table] & "'[" & [To Column] & "]"
        )
EVALUATE _Result

This query works at Dax Studio for example:

 

marcio_fornari_0-1738069007775.png

 

 

12 REPLIES 12
marcio_fornari
Resolver I
Resolver I

Any updates about this? 

In my case, it was taking too long and having too much impact.
I had to rewrite my PowerShell code to use AdomdConnection, AdomdCommand et AdomdDataReader via the XMLAEndpoint.

Allegedly will be fixed by end of April, allegedly.

lbendlin
Super User
Super User

Confirmed, We'll probably raise a ticket as well.

Here's what I got back:

I would like to let you know that Microsoft already found this issue and working on the fix, unfortunately there is no ETA information yet.
 
Meanwhile, could you please follow this workaround given below and let us know if you have any issue.
•	If the model is in premium, customers might be able to switch their solutions to XMLA Endpoint-based connections and query semantic models by using the AS client libraries (ADOMD.NET).

Yes, I got the same answer from them. The problem is still live as of today. Switching to XMLA Endpoint requires some work so we'll wait for the fix.

Hi all ,

Thank you for all your feedback! Once you receive the message that the problem has been fixed, please reply below and accept it as a solution so that more users facing the same problem can find a solution faster. Thank you!

Best Regards,
Dino Tao

samsonfrb
Advocate I
Advocate I

We have the same issue since January 24, 2025. It stopped working with an Error 400 ...

I will open a ticket with Microsoft.

Frederick

lbendlin
Super User
Super User

See if the new INFO.VIEW*  calls cover that.

The Microsoft blocked the INFO.* at this endpoint, any sugestion? 

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries?tryIt=true&source=docs#...


Use the INFO.VIEW calls

 

lbendlin_0-1738087365533.png

 

I need execute the dax at this endpoint: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries 

The microsoft BLOCKED the INFO calls here..

marcio_fornari_0-1738087676384.png

marcio_fornari_1-1738087687792.png

 



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors