Teach Q&A
The Q&A visual didn’t understand the term units because it doesn’t appear in the Wide World Importers data model. The Q&A visual underlines in red the terms it doesn’t understand. If you select units in the Q&A visual, you may be given suggestions to replace units with another term or to define the term. Selecting define units allows you to teach Q&A, as seen in Figure 2-17.
FIGURE 2-17 The Teach Q&A window
In the Define the terms Q&A didn’t understand section, you can teach Q&A that units refers to a certain field—for example, quantity—in the following way:
Enter quantity next to Unit refers to.
Select Save.
Close the Q&A setup window.
The Q&A visual now understands the term units, as you can see in Figure 2-18.
FIGURE 2-18 Q&A showing units by sales territory
Since teaching Q&A can be time-consuming, you can also add synonyms to your data model if you know them in advance, as covered next. This is another example where naming columns in Power Query Editor with friendly names will make this process easier.
Synonyms
Separately from teaching Q&A, you can introduce your own Q&A keywords and make Power BI recognize them. This is especially useful if your business users use acronyms or unique terminology such as substituting margin for profit. You can create a synonym for the Profit field, which will reduce confusion by your report users:
In the Report view, select Q&A setup on the Modeling ribbon.
Select Field synonyms on the left.
Expand the Sale section. You should see a list of fields in the Sale table, as shown in Figure 2-19.
FIGURE 2-19 Field synonyms for the Sale table
Next to Profit, select Add.
Enter margin and press Enter.
Close the Q&A setup window.
If you now enter margin by color in the Q&A visual, you’ll see a bar chart showing Profit by Color, despite not using the term profit explicitly.
Additionally, in the Field synonyms section of Q&A setup, you can exclude specific tables and fields from Q&A if you don’t want Q&A to use the table or field. Hidden objects are excluded by default. This is useful if you need to include staff data in your data model but don’t want users to query this data.
Note Q&A Best Practices
Q&A, when set up correctly, can be a powerful tool that enables data exploration by report consumers. For Q&A best practices, see “Best practices to optimize Q&A in Power BI” at https://docs.microsoft.com/en-us/power-bi/natural-language/q-and-a-best-practices.