Tuning Power BI Copilot With Row Labels And Key Columns

A few weeks ago I wrote a post on how to improve the results you get from Power BI Copilot by editing the Linguistic Schema. As I mentioned, though, there are in fact lots of different ways that you as a Power BI semantic model developer can improve the results you get from Copilot and in this post I’ll show you another one: setting the Row Labels and Key Columns properties on a table.

To illustrate this, I built a semantic model with one table in called Customers. Here are the contents:

There are two important things to notice here:

  1. The Preferred Mode Of Address column contains the full name of the customer. Let’s say there is a business rule that specifies that whenever we display a customer in a report, we need to use the Preferred Mode Of Address column.
  2. Some customers have the same name, and individual customers are identified by their CustomerID (this is not a slowly changing dimension so there is one row per customer).

Now, let’s give Power BI Copilot the following prompt:

show customers by age

This is interpreted as “Showing customers sorted by age”, which is fair enough, and here’s the output:

There are a few things wrong here, but the first one to fix is that it’s showing customers by their first name and not the Preferred Mode Of Address column.

We can fix this by going to the Model View pane in Power BI Desktop, selecting the table itself, and setting the Row Label property on it to the Preferred Mode Of Address column:

The Row Label property of a table has been around since the beginning of Power BI but is very rarely used. For tables that represent entities (such as customers) it indicates which column should be used as the name of the entity.

After making this change, the same prompt (which is interpreted in the same way) now returns the following:

This is better because we’re now showing customers by Preferred Mode Of Address. However there’s another problem: the oldest customer is shown as Fred Blogs with an age of 54. There is no single customer called Fred Blogs with an age of 54 though – there are two different customers called Fred Blogs who are 48 and 6 years old respectively, and Power BI has treated them as the same person and summed their ages.

In order to get Power BI to understand that individual customers are distinguished by the CustomerID column, we need to set the Key Column property on the table to CustomerID:

For tables that represent entities, the Key Column property tells Power BI which column uniquely identifies each entity.

After making this change, the prompt now gives us the result we’re looking for:

As you can see, there are now two separate bars for the two customers called Fred Bloggs – there is one bar for each unique Customer ID.

In conclusion it’s a good idea to set these two properties on most, if not all, dimension tables in your semantic model if you’re planning on using Copilot.

[Thanks to Roseanne Levasseur for telling me about the importance of these properties with regard to Copilot]

Share this Post

Comments (0)

Leave a comment