Text/Sentiment Analysis with Power BI

In Power BI, you can use AI Insights to gain access to a collection of pre-trained machine learning models that enhance your data preparation efforts. AI Insights is accessed in the Power Query Editor, and its associated features and functions are accessed through the Home and Add Column tabs in Power Query Editor.

Remember that

  1. Text analysis with Power BI is much easier with respect to Tableau.
  2. You don’t even need to install Python.
  3. The AI-enabled feature is embedded with Power Bi but not with Tableau.

How to get Dataset

For sentiment analysis, we need some feedback or comments. So, here, we’ll extract comments from my own youtube video.

Copy the youtube video URL and paste it on export comments to extract the video’s comments. After pasting the URL, click on the export process, and now the file is ready to download. Click on the download file.

Steps to follow in Power BI –

Step 1:

  1. Let’s open Power BI and do it from scratch.
  2. Click on Get Data and select Excel workbook.

Step 2:

  • Select the table from the left bottom shown in fig.
  • To transform the data, click on Transform Data.

Step 3:

  • Now, we’ll remove the top rows.
  • Click on remove rows, and select remove top rows.

Step 4:

  • Specify the number of rows you want to remove.
  • Here, we’ll write 2 to delete the top two rows.

Step 5:

  • Now, we’ll make the first row as headers.
  • To transform, click on Transform and then select ‘use the first row as headers.

Step 6: 

  • Click the columns which you want to remove.
  • After that click the remove columns.

Step 7: 

  • Click the field which you want to rename.
  • Now we’ll rename the row as row ID.

Step 8:

Text analytics differences between Tableau and power bi.

  • With tableau, you’ll have to connect that with Python and after that, you need to import packages and so on. 
  • But in power bi directly you have AI-backed powered features like text analytics, and vision as your machine learning AI insight section.

Now we’ll click on Text Analytics.

Step 9:

  • Now, click on score sentiment.
  • So, in the text we’ll select the column name and the column name over there would be the comment.

Second one is the Language ISO code which is optional so we are not going with that for now.

Step 10:

  • Now, we’ll have a sentiment score for each comment.

You can see that one new row has been added as a score sentiment. That is by AI only.

And boom, you can see the score sentiment has been updated for every comment over there. We have got the numbers, but we’ll try to make it like a tableau where we have the color code as well. 

So, we go to the report and we’ll open a new page, a brand new page. After that click the lower one.

So we’ll select comments and then we’ll select score sentiment.

Remember that it will vary from zero to one. In Tableau, it will vary from -1 to 1.

So if you are close to zero means a negative comment, close to one means a positive comment, and around 0.5 means neutral command

And after this, we can go to sentiment analysis, conditional formatting, and background color. It’s like orange to blue.

We can sort this out so that we have positive comments at the top itself. Now, we’re done with sentiment analysis on Power BI.

I hope this post was useful for you and it will help you to kick-start your journey in Text sentiment analysis with Power bi.

Ritesh Bisht

1st in the world to hold Tableau Ambassador and Power BI Super User Titles