The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
GetExpression
GetType
OnInvoke
And on the Publish record, I have SupportsDirectQuery=true there.
Are there others I need to do to support direct query?
Solved! Go to 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.
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.
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.
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.
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.
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.
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.
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.
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |