Employee surveys are a goldmine of insights, but if you have ever scrolled through hundreds of open-text comments, you know how hard it is to make sense of them. People rarely keep their answers short: they explain, complain, praise, and occasionally get sarcastic. Traditional sentiment analysis tools help, but they rely heavily on keyword matching, often falling flat when it comes to what people really mean.
But that’s changing thanks to generative AI tools such as ChatGPT.
By integrating ChatGPT directly into Power BI, you can analyze open-text comments at scale, extracting sentiment or classifications with far more nuance than standard keyword-based methods. The best part is you don’t have to worry about all the NLP technicalities here; you simply invoke ChatGPT through a custom function in Power BI and let it do the heavy lifting.
Let’s walk through how to set it up.
Step 1: Prepare Your Dataset
- Start with a basic dataset with the following.
- Employee ID
- Department
- Survey Feedback (this is the open-text input we will analyze)
Here’s the sample file I used.
Load this data onto Power BI. In this example we are using Excel but the data can come from any source such as SQL Server or your own HRIS export. The key is to have a column with employee comments.

Step 2: Get Your OpenAI API Key
To access ChatGPT, you will need an OpenAI API key. You can sign up and generate one easily from the OpenAI platform.
Depending on your use case, different models are available, but for our task, “gpt-5-nano” works perfectly well (and is cost-effective).
Step 3: Create a Custom Function in Power Query
Now that we have our dataset and the API key, let’s set up the custom function that sends the employee feedback to ChatGPT. This function will return a sentiment classification based on the employee feedback.


Copy the below code into the “Advanced Editor”
let
// Function to call ChatGPT API
ChatGPTFunction = (promptText as text,promptcol as text) =>
let
url = "https://api.openai.com/v1/chat/completions",
headers = [
#"Content-Type" = "application/json",
#"Authorization" = "Bearer xxxxx" // Replace with your OpenAI API key
],
body = Json.FromValue([
model = " gpt-5-nano",
messages = {
[role = "system", content = "You are a helpful assistant."],
[role = "user", content = promptText & " "&promptcol]
},
max_tokens = 100,
temperature = 0.7
]),
response = Json.Document(Web.Contents(url, [
Headers = headers,
Content = body
])),
result = response[choices]{0}[message][content]
in
result
in
ChatGPTFunction
Step 4: Apply the Function to Survey Feedback
Once your custom function is ready, apply it directly to the Survey Feedback column.
Here’s how:
- In Power Query, select the Survey Feedback column.
- Choose “Invoke Custom Function”


- Type the prompt “Classify the feedback as Positive, Negative, or Neutral. Return one word only.” This avoids complexity and keeps responses clean for dashboarding.
- A new column will be created containing outputs like Positive, Negative, or Neutral.

And just like that, you have connected Power BI to ChatGPT. Every comment is now processed, analyzed, and ready for visualization.
Step 5: Build a Sentiment Dashboard
Now the fun part. With sentiment results in hand, you can:
- Visualize overall sentiment using a pie or bar chart

- Break down sentiment by department to see where issues may emerge.
- Track sentiment over time if you run recurring surveys
Now, instead of spending weeks combing through employee feedback manually, you have got a near real-time pulse on how employees are feeling and where leadership should focus next.
Why This Matters for HR Teams
Surveys are only valuable if you can act on them. The reality is that most open-text feedback ends up in a spreadsheet nobody reads because analysis is just too time-consuming.
By pulling ChatGPT into Power BI, HR gains a fast, scalable way to:
- Identify patterns in feedback
- Flag departments showing signs of disengagement
- Measure if changes are actually improving sentiment
And unlike legacy text analysis tools that rely on simple keywords, ChatGPT can understand tone and context. For example:
“I guess it’s fine, but I don’t feel heard” is not the same as “everything is fine.”
A Few Things to Keep in Mind
- Cost: Each API call has a cost, so if you are analyzing thousands of comments, plan accordingly.
- Privacy: Never send personally identifiable data. Strip out names, IDs, or sensitive details before calling the API.
- Consistency: Prompt design matters. Be clear about what you want ChatGPT to return (e.g., “respond with one word only”), otherwise you may get inconsistent outputs.