Using Q&A in reports and dashboards – Using Data Model Advanced Features

Using Q&A in reports and dashboards

An easy way to get started using Q&A is to add the visual to a report.

Figure 6.3 – Button to add a Q&A visual to a report

The first time this visual is added to a report, you may see the following message:

Figure 6.4 – New Q&A visual added to a report

This indicates that the Q&A feature is not yet enabled for this Power BI file. From here, click Turn on Q&A to enable the feature. When Q&A is enabled for a file, an index of the data will be created. This index is updated regularly when a file is open in Power BI Desktop and when reports are published to the Power BI service, they require no maintenance by the user. After this happens, the visual will load and you may see something like this:

Figure 6.5 – Example Q&A visual on a report

Upon the first load, Q&A will attempt to show example questions to help users get started asking natural-language questions of this dataset. Those are shown in the blue boxes near the bottom of the visual, as seen in Figure 6.5. When the example queries are selected, the text is populated in the search text box and then a few seconds later, the query runs against the data. This gives the user time to see the query and make changes if desired.

Figure 6.6 – Example Q&A query showing blue underline

When Power BI understands that a word in a natural-language query relates to a field in the dataset, the word gets underlined in blue, as seen in Figure 6.6.

When users type in natural-language queries, Q&A provides autocompletion to help the user navigate the data and find questions that can be asked of the data. For example, if we have a dataset containing only customer contact information, we could probably ask how many customers do we have in each state?, but we need to ask this in a way that aligns with the data model.

Figure 6.7 – Q&A visual showing suggestions for a query

We can see in Figure 6.7 that Q&A is making autocomplete recommendations based on the word state and that it seems like a field in our StateProvince data model. After accepting the top suggestion, we’re able to instantly see the visual created for us by Q&A.

Figure 6.8 – Q&A visual showing count of customers from each state ordered from most to least in a bar chart

At any time while querying with natural language, the resulting visual is shown below it, and the B18086_06_010.png button can be clicked to turn the visual shown into a standard visual in the report. This is one of the ways the Q&A visual makes it easier for report designers to build reports.

At the top of the visual, we can see that we can help Q&A better understand the data model by providing synonyms. In the example query used previously, how many customers do we have in each state?, we noted that the word state was not immediately recognized as the StateProvince field in our data model. While sometimes autocomplete suggestions will help us here, it’s also possible the autocomplete doesn’t recognize the words used in your data model. If you’re using a word that is domain-specific, then you may need to provide synonyms that will help Q&A better understand your data model.

In addition to synonyms, there are more advanced capabilities by providing a linguistic schema in the form of a *.yaml (YAML) file, which is possible from Power BI Desktop. We’ll cover that in the next section.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart

close