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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sneaky
New Member

Whats the requirements to create a custom connector for Power BI that supports direct query?

I am trying to developer a custom connector for power BI which supports direct query mode getting data from my API. Problem is whenever I try to create one, it always defaults to Import mode for storage and no ability to change to direct query. I guess I am not implementing the query folding properly. Does anyone have any tutorial or code with a minimal working example?

In my Contents function, I implement 

GetRows

GetExpression
GetType

OnInvoke

 

And on the Publish record, I have SupportsDirectQuery=true there.

 

Are there others I need to do to support direct query?

1 ACCEPTED SOLUTION

Hi @Sneaky ,

Thank you for your response. Proper implementation of Table.View is essential for enabling DirectQuery, particularly with custom Power BI connectors.

I wanted to share a resource that may be useful TripPin 10 - Basic Query Folding - Power Query | Microsoft Learn

This example demonstrates how to define GetRows, GetType, and GetExpression to effectively support query folding.

 

I hope this is helpful.

 

Best regards,

Community Support Team.

View solution in original post

10 REPLIES 10
Sneaky
New Member

I tried this, but still could not get it to work. Is it possible you could provide an example code (least possible code) which makes direct query working?

Hi @Sneaky ,

Thank you for your response. Proper implementation of Table.View is essential for enabling DirectQuery, particularly with custom Power BI connectors.

I wanted to share a resource that may be useful TripPin 10 - Basic Query Folding - Power Query | Microsoft Learn

This example demonstrates how to define GetRows, GetType, and GetExpression to effectively support query folding.

 

I hope this is helpful.

 

Best regards,

Community Support Team.

Hi @Sneaky ,

Has your issue been resolved, or do you need any additional information? Your feedback is important to us. If the solution worked for you, please mark it as 'Accepted Solution' to help other community members with similar questions.

TheInvoker
Frequent Visitor

I tried this, but still could not get it to work. Is it possible you could provide an example code (least possible code) which makes direct query working?

Hi @TheInvoker,

Please refer to the link below they contain sample code that demonstrates how to structure and implement this correctly for testing purposes.


Link: TripPin 10 - Basic Query Folding - Power Query | Microsoft Learn

 

Regards,

Community Support Team.

v-tsaipranay
Community Support
Community Support

Hi @Sneaky ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-tsaipranay
Community Support
Community Support

Hi @Sneaky ,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @Sneaky ,

Please let me know if my response was helpful or if you are still experiencing any issues. If the problem is resolved, you can mark it as solved.

Thank You.

V-yubandi-msft
Community Support
Community Support

Hi @Sneaky ,

Thanks for reching out community. @Akash_Varuna ,  totally agree that getting Table.View implemented correctly is key for DirectQuery to work smoothly.

Just to add to your point  along with GetRows, GetExpression, and GetType, it's also helpful to confirm that your query folding logic aligns with what's expected for AST, especially if you're handling dynamic query shapes.

 

If your connector is calling a REST API, Microsoft doesn’t support DirectQuery directly over HTTP you’ll typically need to proxy it through an ODBC driver or similar middleware that can translate to a supported DirectQuery interface.

 

Helpful Reference:

Enabling DirectQuery for an ODBC-based Power Query connector - Power Query | Microsoft Learn

 

Regards,

Yugandhar.

 

Akash_Varuna
Super User
Super User

Hi @Sneaky To enable Direct Query in a custom Power BI connector, implement Table.View with proper query folding by defining GetRows, GetExpression, and GetType. Add SupportsDirectQuery = true in the Publish record. Ensure your API supports query-based operations and pagination to handle dynamic queries. Test with Power BI Desktop to confirm query folding is functioning correctly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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