Table.Profile takes a table and returns a new table that summarises each column in one row: the column name and type, the number of rows, how many values are null, distinct values, minimum and maximum, and for numeric columns the average and standard deviation. It is the fastest way to eyeball a table you have just imported before you start cleaning it. You can run it from a blank query with M code, or from the Power Query Editor interface via a custom column, and it works the same in Excel and in Power BI Desktop because both use the same Power Query engine.

What You'll Need

  • Power Query Editor open in Excel (Data tab, then Get Data, or From Table/Range) or in Power BI Desktop (Transform data).
  • A query that already returns a table. Table.Profile only accepts a table value, so run it after your source step, not on a list or record.
  • No additional add-ins. Table.Profile is part of the standard M function library, so it is always available.
  • A little comfort with the Advanced Editor or the formula bar, since the function is not exposed as a single ribbon button.

Step-by-Step

  1. Load your data into Power Query as normal. For a quick test in Excel, select a populated range and use Data, then From Table/Range. In Power BI Desktop use Home, then Get data, and choose your source.
  2. Do at least the bare minimum cleanup first: promote headers and set column types. Set types with Transform, then Data Type, or by clicking the small type icon in each column header. Types matter because Table.Profile calculates averages and standard deviations only on columns typed as numbers; a text-formatted numeric column just gets minimum and maximum on the text.
  3. Rename the query to something memorable, such as Sales_Data, in the Queries pane. You will reference this name later.
  4. Create a new blank query. In Power Query Editor go to Home, then New Source, then Other Sources, then Blank Query. In Power BI Desktop the blank query option sits under New Source as well; labels differ slightly between versions and regions, so look for the blank query entry rather than an exact wording.
  5. Open the Advanced Editor for the new blank query (Home, then Advanced Editor) and replace the default code with a reference to your table wrapped in the function. If your query is called Sales_Data, the code is:

    Table.Profile(Sales_Data)

    Note that there are no parentheses after Sales_Data. You are passing the query itself, not calling it.
  6. Click Done. The preview now shows one row per column of the original table, with the profile columns described above.
  7. To inspect a single column rather than all of them, add the optional second argument. Table.Profile accepts a list of column names, so Table.Profile(Sales_Data, {"Region"}) returns a row only for Region. Wrap multiple names in the same list separated by commas.
  8. Rename the result query from Query1 to something like Sales_Data_Profile so it is obvious it is an inspection query, not the table you will load.
  9. Decide where the profile goes. If you only need to look at it, leave the query as connection only: right-click it in the Queries pane and clear the Load, Enable load or Include in report refresh option as appropriate for your version. If you want to keep an audit trail, load it to a worksheet or to a Power BI table.
  10. Act on what you see. Rows with a high null count usually mean a mis-mapped source column. A distinct count of 1 means the column carries no information for reporting. A minimum of zero on a price column often points to placeholder rows. Negative values in a column of counts are worth investigating before they reach a chart.

Common Mistakes

  • Leaving every column as text. Numbers stored as text give you no average or standard deviation, which is half the value of the function. Always set types before profiling.
  • Passing a list or record instead of a table. Table.Profile is strictly for tables; if your step returns something else, wrap it in Table.FromList or Table.FromRecords first.
  • Calling the query name with parentheses, as in Sales_Data(). That evaluates the query differently and typically produces an error.
  • Profiling before headers are promoted, so every column is named Column1, Column2 and so on and the output is unreadable.
  • Loading the profile query to the model and forgetting it. It becomes an extra table in your report or worksheet that users can see, which is usually not what you want.
  • Chaining more steps onto the profile query and expecting those steps to change the underlying data. The profile is a summary; transforms applied to it affect the summary only.

Tips

  • Keep the profile query at the very end of your query list and name it with a clear suffix so it is never confused with the load query.
  • Table.Profile is a good first step when you inherit an unfamiliar dataset, because the distinct count alone tells you which columns are keys and which are free text.
  • For a quick visual version of the same idea without writing code, use the Column profile and Column distribution options in the View tab of the Power Query Editor. They give you per-column statistics in a panel below the data preview.
  • If you want a reusable check, turn the pattern into a custom function that accepts any table argument, so you can point it at each new source without rewriting the code.
  • Combine the profile output with a filter on the Null Count column to surface only the columns with missing values.

Troubleshooting

If the query errors immediately, check you are passing the query by its exact name as shown in the Queries pane. Renaming the source query without updating the profile query is the most common cause of a "not found" style error.

If the preview shows one column with an odd name such as Column1 and a single row, you are probably profiling a table that has already been pivoted or reduced to a single column. That is not an error, but it means your earlier steps did something you did not intend; step back through Applied Steps and look for an unintended pivot or remove columns.

If numeric statistics are missing, return to the source query and confirm the type. A column showing the ABC icon is text. Change it to Decimal Number or Whole Number, then refresh the profile query.

If the profile does not refresh with new data, check the privacy level and load settings: a connection-only query still refreshes when the workbook or model refreshes. If results look stale, use Home, then Refresh Preview in the editor, and check Data, then Queries and Connections, then Refresh All in Excel.

Frequently Asked Questions

Is Table.Profile available in both Excel and Power BI?

Yes. Both use the Power Query engine, so the function behaves identically. Only the surrounding menus differ.

Does Table.Profile change my data?

No. It returns a separate summary table. Your original query and source data are untouched.

Can I profile just some columns?

Yes. Pass a list of column names as the second argument, for example Table.Profile(MyTable, {"Name", "Total"}).

Why are average and standard deviation blank?

Those statistics are only calculated for numeric columns. Set the correct data type on the source column first.

Can I profile a table inside another step without creating a new query?

Yes, provided the table reference is a valid name in scope, but a dedicated profile query is easier to read and to remove later.

Does it work on very large tables?

It summarises every column, so refresh time grows with column count and row count. Set types and remove unneeded columns before profiling a wide table.