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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
darshaningale
Resolver II
Resolver II

Python with Direct query in PowerBI desktop

I am using Python code to fetch data from SQL server with help of DirectQuery.

I want to pass one parameter to the select query and also want to execute python code to generate another set of columns.

It seems Pythonscript doesnt work with Direct Query.

Please guide.

5 REPLIES 5
amitchandak
Super User
Super User

@darshaningale , As far as I know, the python script method to load data is import mode

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

So, the idea of direct query is to unnable any kind of transformation in PowerBI? I mean, python doesn't work, power query doesn't work, DAX is extremly restricted. Care to explain?

ckeo
Frequent Visitor

No reply because no one knows. DirectQuery is useless in that mentioned cases. 

 

I believe Direct Query is meant for data that has already been transformed in your data source completely.

Agreed, came to the same conclusion and went to transform in the source

So is it that we cannot write python script for direct query ? Power BI Desktop allows to do it but shows error while executing it.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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