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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
SEMattis
Advocate III
Advocate III

DMV Queries using Power BI Rest Api executeQuery endpoint

Hi community,

 

I'm trying to build a cloud function that is querying the underlying measure meta data from the DMVs. To query the DMVs I'm using Python's request library using the following code:

 

secrets = obt_sec()
    auth_result = auth()
    token = auth_result['access_token']
    headers = {'Authorization': f'Bearer {token}',
               'Content-Type': 'application/json'}
    body = '''{'queries' : [
            {'query': 'select * from $System.MDSCHEMA_MEASURES'
                        }
            ],
            'serializerSettings': {
            'includeNulls': 'false'
            }
        }'''
    response_data = get_datasets['value']
    metaData = {}
    for response in response_data:
        pbi_dataset = response['id']
        meta_request = rq.post(f'https://api.powerbi.com/v1.0/myorg/datasets/{pbi_dataset}/executeQueries', headers = headers, data = body).json()
        print(meta_request)
        data = {pbi_dataset: meta_request['value']}
        metaData.update(data)
        print(metaData)
    return metaData
 
Problem is that when sending the post request to the DMV endpoint I'm getting the following error. 
 
{'results': [{'tables': [{'rows': [{'CATALOG_NAME': 'HASHED', 'CUBE_NAME': 'Model', 'MEASURE_NAME': 'Text_User', 'MEASURE_UNIQUE_NAME': '[Measures].[Text_User]', 'MEASURE_CAPTION': 'Text_User'}]}], 'error': {'code': 'DaxDataTypeNotSupported', 'message': 'Encountered a value of type System.Int32. This type is not supported.'}}]}
 
I need some support in what and where I am doing the wrong thing!
1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hi. The docs says "Only DAX queries are supported at this time. MDX and DMV queries are not supported." 

You can't use DMV with ExecuteQueries endpoint request. It's on the limitations: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

1 REPLY 1
ibarrau
Super User
Super User

Hi. The docs says "Only DAX queries are supported at this time. MDX and DMV queries are not supported." 

You can't use DMV with ExecuteQueries endpoint request. It's on the limitations: https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors