Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I’m working on integrating ChatGPT or Google Gemini into Power BI using a custom visual to enable interactive AI responses directly from the report, based on the dataset contents.
Everything works fine when I test the API in Postman, but Power BI blocks the API call from the custom visual due to security restrictions, most likely related to Content Security Policy (CSP) or cross-origin (CORS) issues.
Built a custom visual in Power BI using React and TypeScript
Integrated OpenAI/Gemini API logic inside the visual
Created a proxy API server to forward the API requests
Used tunneling tools like:
Localtunnel
ngrok
But unfortunately, the API calls are still being blocked when the custom visual is rendered inside Power BI Desktop
How can I successfully connect Power BI custom visual to OpenAI/Gemini API through a proxy or tunnel?
Is there a recommended tunneling or reverse proxy approach that works with Power BI visuals?
Please share your thoughts.
Any guidance or step-by-step solution would be greatly appreciated!
Thanks!
Hi @jesikamaurya,
long time no answer to your question. Maybe I can help you here.
There is a new feature for Fabric/Power BI called User Data Function.
Check out the blog here: Announcing Fabric User Data Functions (Preview) | Microsoft Fabric Blog | Microsoft Fabric
I already saw demos from Microsoft where they put an API call in a UDF to call a LLM endpoint. This function was then provisioned to Power BI for calling and taking the input data from the report.
Best regards!
PS: If you find this post helpful consider leaving kudos or mark it as solution
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |