Nowadays, if you are going to know about any self-service business intelligence tool, you don’t want to limit yourself to explore only data visualization. With the same thought, I explored the advanced features of Power BI and found the smart features of Power BI.
In this blog, you will learn how to create a Q&A visual without writing a single line of code.
I consider the US Superstore dataset from Kaggle.
- Let’s start with the Get Data option under the Home tab. As this is a CSV file, select the Text/CSV option from the drop-down list
- Select the file named US Superstore data.csv
- After selecting the file, data will be displayed in the below format
- Click on Load and save data.
- In this data model, create one date table with required columns. You can follow my blog about date table creation.
How to Create
If you use any of the above options, the first view will be like below.
If you type your question in the text area, automatically it comes up with suggested questions like the below section of the view.
If you click on any question, the text will copy in the input area and the answer will be generated. It will happen every time of click.
Example 1: Only One Measure
Now you type one simple measure “Total Sales” or “Sales” and observe multiple suggestions are visible as the drop-down list.
One thing to remember suggested measures should be pre-calculated by you.
When you click on any one of them and answer will display in the visual area.
Example 2: One Measure by One Dimension
Let’s type Total Sales by Category. Here Total Sales is measure and Category is dimension value. Your aim to find the answer for categorical sales information.
After selecting the suggested question, the report displays
Example 3: One Measure by One Dimension with a Filter
It’s time to explore with a filter. Now you add one filter condition in your question section and observe the answer.
After converting Q&A Visual to Standard Visual, you find standard visual like a clustered bar chart added filter condition whatever you have provided in the question area.
Example 4: Visual with Geographical information
If you type any question with geographical information, for example by city or country etc., there are two possibilities to display the answer.
In the dataset, if you have latitude and longitude information, then it will take a map view by default. Then you can type for example “by bar” to convert the chart type from the map to bar.
But in the dataset, there is only city, country information, then by default bar chart will display. In this case, you need to type “by map” and convert to map view instead of a bar.
Example 5: Q&A Button and Q&A Dialog
- Go to the Insert tab.
- Under the Elements section, Click on Buttons drop-down and select Q&A
- The Button view with all format options will display
4. Press Ctrl+Click on the button view and Q&A Dialog will open.
5. In this box, you need to questions and find the answer accordingly. But you can’t add this view to your report page.
6. However you can add this feature to your report page.
If you want to categorize based on keyword search, then there can be some possible options.
- With aggregate words like total, sum, count, average etc.
- With comparison and range related words like a top, versus, and, or etc.
- Query related words like sort, ascending, descending.
- Visual type related like bar, line, table etc, mainly related to standard visualization.
As you understand in your data model, if you do not have a similar name then in Q&A visual will not provide any answer.
In our example data model, we have already sales word, so whenever we are searching with sales, answers are displayed.
Now you type “loss”, you will not find any result. But for the profit, we have a positive value as well as a negative value. A negative value means loss related value.
How will you handle this type of situation? Let’s find out in the below steps.
After making all changes, now if you type loss in Q&A visual, you will find the answer. Though it is the combined value of profit and loss.
Q&A Set Up
Till now, you observe different questions which are mainly related to the defined data model.
If you want to add some set of questions related to your project, then you can go for the following options.
- Under the Modelling tab, go to the Q&A group.
- Three options: Q&A setup, Language, Linguistic schema
- The main option is Q&A setup.
Please find the code in the below location
In this blog, we understand how natural language is used to ask any questions and how Q&A visual is providing the answers.
In my next blog, we will learn more about AI and Power BI.
If you have any questions related to this project, please feel free to post your comments.
Please like, comment and subscribe to my YouTube channel which you have already seen. 🙂 Keep Learning.