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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
djwbaker
Frequent Visitor

TSQL power bi API in SSMS

Hi Has anyone been able to query Power bi datasets using TSQL in SSMS?
I can use MDX, DAx And XMLA. But i cant seem to activate the TSQL option, any ideas?

cheers Dan

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @djwbaker,

AFAIK, power bi rest API does not include t-SQL operate features.
Perhaps you can try to use SQL connector with an advanced t-sql statement and parametrize with query parameter then you can use rest api to modify them on the power bi service side.

Power Query SQL Server connector | Microsoft Docs

Using the Power BI Service Parameters to change connection strings (To possibly change between Dev 

Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Docs

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @djwbaker,

AFAIK, power bi rest API does not include t-SQL operate features.
Perhaps you can try to use SQL connector with an advanced t-sql statement and parametrize with query parameter then you can use rest api to modify them on the power bi service side.

Power Query SQL Server connector | Microsoft Docs

Using the Power BI Service Parameters to change connection strings (To possibly change between Dev 

Datasets - Update Parameters - REST API (Power BI Power BI REST APIs) | Microsoft Docs

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
dm-p
Super User
Super User

Hi @djwbaker,

Power BI data models are not conventional SQL database tables, and rather Analysis Services (Tabular) models. As such, T-SQL is not a valid way to query them, whereas MDX/DAX/XMLA are all appropriate languages suitable for doing this. As such SSMS will not enable T-SQL here, but enable the others, as you're experiencing.

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.