Excel · M · Power BI · Power Query

Adding Tooltips To Column Headers In The Power Query Editor In Power BI And Excel

Here’s something that will excite all you M nerds out there! Did you know you can make tooltips appear when you hover over column headers in a table in the Power Query Editor in either Power BI Desktop or Excel?

It’s all done with M metadata, and here’s an example query:

source =
#table({"firstname", "lastname"}, {{"matt", "masson"}}),
tableType =
type table[firstname = Text.Type, lastname = Text.Type]
meta [
Documentation.FieldDescription =
[firstname = "Given Name", lastname = "Family Name"]
replaceType = Value.ReplaceType(source, tableType)

Here’s what you see when your mouse hovers over the firstname column in the Power Query Editor:

…and here’s what you see when your mouse hovers over the lastname column:

How does this work? Here’s what each of the steps do:

  • The source step creates a simple table with two columns called firstname and lastname using #table (see here for more details on that).
  • The tabletype step declares a new table type with two columns (the same two columns in the table from the previous step) and then adds a metadata record to this type. In that record the Documentation.FieldDescription field contains the text values that will appear as tooltips when you hover over each column.
  • The replacetype step replaces the type of the table returned by source with the type declared in tabletype.

The Power Query Editor UI then looks for a Documentation.FieldDescription field in any metadata associated with a table and displays the values in that field when you hover over the appropriate column.

Note that if you add any steps to your query after this that change the table type (for example that add or remove columns), the metadata is removed ☹. That said I still feel like this might be a useful feature for anyone building a custom connector, for example.

[Thanks to Matt Masson for telling me how all this works]

8 thoughts on “Adding Tooltips To Column Headers In The Power Query Editor In Power BI And Excel

  1. Thanks Chris et al!

    I am planning to use the Enter Data Dialog in PBI to for user entry and adding tooltips would have been useful…..

    It was quite easy. (Added meta [ Documentation.FieldDescription = [Name = “Name”, URL = “URL”, Type = “ZYX”]] )

    Unfortunately the addition of the metadata removes the ability to edit data…..

    Would be helpful if you have a static table though!

    = Table.FromRows(
    let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, URL = _t, Type = _t] meta [ Documentation.FieldDescription = [Name = “Name”, URL = “URL”, Type = “ZYX”]]

  2. Great Post and I know this is old now but what’s the best approach to showing tooltips on the columns headers on table/matrix visual?

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.