Enhance your PowerBI dashboards with the ChatGPT Custom Visual!

I am currently working on developing a custom visual for Power BI using TypeScript. This visual includes an input field for user prompts and another input field for ChatGPT answers. The main goal is to allow users to ask questions about the data in their reports or any visual in the report, and receive relevant answers. Here's a sneak peek at the current stage of the visual:

https://i.sstatic.net/yr5Bv.png

Behind the scenes, the user prompt is sent to Azure-OpenAI service and processed by the ChatGPT deployment to generate a response. However, I'm looking to enhance this functionality by also incorporating the report's data. I came across a video showcasing something similar with Power Automate visual, you can watch it here: https://youtu.be/q1XszZrZ3es

https://i.sstatic.net/ZHKxo.png

In the video, they successfully pass the report's data through the Power Automate visual into the user prompt for combined analysis with the data question. Inspired by this, I've managed to achieve a similar outcome by structuring the visual's data in JSON format along with the prompt. It works well, but now the question arises - is it feasible to access the report's data within the custom visual using TypeScript without embedding the dataset directly?

I've attempted to utilize the PowerBI Client library within my custom visual, but it seems that this only works with PowerBI Embedded, causing the visual to malfunction:

  1. https://www.npmjs.com/package/powerbi-client
  2. https://github.com/microsoft/PowerBI-JavaScript

This article suggests that it may not be possible to fetch data from other visuals at the page or report scope level using a custom visual:

Any thoughts or suggestions on how to overcome this limitation?

Answer №1

After extensive research, it is currently not possible to achieve this through PowerBI due to limitations in accessing complete report data. As a solution, I have pivoted towards creating a langchain server within a Kubernetes cluster that connects directly to the database housed within the same cluster. This server has the ability to convert questions into SQL queries, execute them within the infrastructure, and then feed the results back to chatGPT for HTML visualization generation.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unable to break down the property 'desks' of '(0 , _react.useContext)(...)' due to its undefined nature

Trying to mock DeskContext to include desks and checkIfUserPresent when calling useContext is causing an error to occur: Cannot destructure property 'desks' of '(0 , _react.useContext)(...)' as it is undefined TypeError: Cannot destruct ...

Error encountered when asynchronously iterating over an object in TypeScript

Could someone please help me understand why I am getting an error with this code? var promise = new Promise((resolve, reject) => { resolve([1, 2, 3, 4, 5]); }); async function doSomethingAsync() { var data = await promise; data.forEach(v = ...

Unable to assign a value to an undefined property in TypeScript

I need to store data in an object and then add it to another object let globalSamples = {} as any; let sample = { } as ISamplesDetail []; sample = []; for (let i = 0 ; i<this.prelevementLingette.samplesDetail.length; i++) { sample [i].id= thi ...

Error TS2339: The 'email' property is not found in the 'FindUserProps' type

interface FindUserEmailProps { readonly email: string } interface FindUserIdProps { readonly id: string } type FindUserProps = FindUserEmailProps | FindUserIdProps export const findUserByEmail = async ({ email }: FindUserProps): Promise<IUser&g ...

What is the reason for encountering a TypeScript error when using a union type?

interface Bird { age:string, eat:()=>any } interface Fish { age:string, swim:()=>any } type Pet = Fish | Bird; everything looks good so far, defining a Pet type const pet:Pet={ age:"sd", eat:()=>{} } when trying to return ...

Encountering errors in Typescript build due to issues in the node_modules directory

While running a typescript build, I encountered errors in the node_modules folder. Despite having it listed in the exclude section of my tsconfig.json file, the errors persist. What's puzzling is that another project with identical gulpfile.js, tsconf ...

What is the best way to send an array of locationIds to the getLocationData service?

Seeking Assistance on Sending an Array of Location IDs to a Service I currently have an array consisting of location IDs. locationArr=[40871, 60009, 38149, 40868, 43240, 15299, 53897, 40976, 38151, 23183, 38152, 78579, 23180, 40977, 23176, 39565, 40884, ...

I am looking to integrate Firebase app-check into my Angular 12 application. Can anyone guide me on

I have attempted the suggestions provided in this particular inquiry Here is the code snippet I am working with: // firebase-init.ts import firebase from 'firebase/app'; import 'firebase/app-check'; import { environment } from ' ...

Type guard does not narrow down the union type

Explore the following code snippet: type UnionType = 'foo' | 'bar' | 'baz' const obj = { foo: 'huh', bar: 'hmm' } function func(input: UnionType) { if(input in obj) { input } } In ...

There was a problem with Type TS2507: The Type 'typeof Tapable' cannot be used as a constructor function type

After creating my own TypeScript library for shared TS models, I wanted to incorporate it into a couple of other projects I'm working on. Here are the essential parts of the library repository: index.ts: export interface IApp { ... } package.json: ...

Using the original type's keys to index a mapped type

I am currently developing a function that is responsible for parsing a CSV file and returning an array of objects with specified types. Here is a snippet of the code: type KeyToTransformerLookup<T> = { [K in keyof T as T[K] extends string ? never : ...

Customizing a generic method in typescript

I am currently working on developing a base class called AbstractQuery, which will serve as a parent class to other classes that inherit from it. The goal is to override certain methods within the child classes. class AbstractQuery { public before< ...

Exploring the capabilities of Angular2 and Jasmine through testing

I have been working on a basic spec for a component and I'm curious about the test's behavior. The test is designed to verify if a component is successfully created. It seems that when the test is executed, it first compiles and runs the Compone ...

Unable to locate the next/google/font module in my Typescript project

Issue With Import Syntax for Font Types The documentation here provides an example: import { <font-name> } from 'next/google/font'; This code compiles successfully, but throws a "module not found" error at runtime. However, in this disc ...

Utilizing Typescript within Visual Studio Code alongside node_modules

I currently have typescript installed and am utilizing the powerful visual code editor. Whenever I attempt to navigate to the definition of a typescript function in the node_modules directory, Visual Studio Code ends up expanding the entire 'node_mod ...

Angular production application is experiencing issues due to a missing NPM package import

Objective I am aiming to distribute a TypeScript module augmentation of RxJS as an npm package for usage in Angular projects. Challenge While the package functions correctly in local development mode within an Angular application, it fails to import pro ...

Using array values with styled-components may lead to an object being potentially 'undefined'

Currently, I am developing a custom Skeleton component that allows for the input of a property called circleSizes. This property is an array of numbers used to define the width and height of the Skeleton element. Below is the code snippet for the componen ...

Lazy-loaded modules in Angular that contain services provided within the module

Currently, I am facing a challenge with lazy-loaded modules and services that are provided in these modules. My folder structure looks like this: app -> featureModule1 (lazy loaded) -> featureModule2 (lazy loaded) -->services --->servi ...

In TypeScript, make sure to verify the type of an object to avoid any potential compilation errors stemming

Here is the code snippet: export default class App { el: HTMLElement; constructor(el: string | HTMLElement) { if (typeof el === "string") { this.el = document.getElementById(el); } if (typeof el === typeof this.el) { t ...

When I utilize the redux connect function, the class information in my IDE (PhpStorm/WebStorm) seems to disappear

When I use the connect function from redux, it seems to hinder my IDE (PhpStorm) from "Find Usages" on my classes. This is likely because connect returns any, causing the type information from the imported SomeClass file to be lost. export default connect ...