Power BI custom columns let you transform or combine existing data directly in your table to create new, calculated fields without altering the source. This is essential for enriching your dataset with derived metrics like totals, categories, or text manipulations. You need only a Power BI Desktop installation and a dataset loaded into the Power Query Editor — no external tools or licenses beyond Power BI Pro or Premium are required.

What You'll Need

  • Power BI Desktop (latest version from Microsoft's official site)
  • A data table already loaded into the Power Query Editor
  • Basic understanding of column names and data types in your dataset

Step-by-Step

  1. Open Power BI Desktop and load your data source (e.g., Excel, CSV, SQL Server) using the Get Data button on the Home tab.
  2. Once data appears in the preview, click Transform Data to open the Power Query Editor.
  3. In the Power Query Editor, locate the table you want to add a custom column to. Ensure it's selected in the left-hand Queries pane.
  4. Go to the Add Column tab in the ribbon at the top.
  5. Click Custom Column. A dialog box titled Add Custom Column will appear.
  6. In the New column name field, type a clear, descriptive name for your new column (e.g., TotalSales, RegionCategory).
  7. In the Custom column formula box, enter your calculation using Power Query M language. For example, to multiply two columns, type: [Quantity] * [Price]. To combine text, use: [FirstName] & " " & [LastName].
  8. Use the column names from the dropdown list below the formula box — do not type them manually unless you're certain of the exact spelling and case.
  9. Choose the data type for the new column from the Output type dropdown (e.g., Whole Number, Decimal Number, Text). This affects how Power BI displays and calculates the result.
  10. Click OK. The new column will appear as the rightmost column in your table.
  11. Review the column values to confirm the formula works as intended. Look for errors like #value or #null.
  12. Click Close & Apply in the top-left corner to save changes and return to the report view.

Common Mistakes

  • Typing column names manually instead of selecting them from the dropdown, causing case-sensitive errors (e.g., quantity vs. [Quantity]).
  • Forgetting to wrap text in quotes when concatenating strings, leading to syntax errors like [FirstName] & " " & LastName (missing quotes around LastName).
  • Using division or arithmetic on columns that contain null or non-numeric values, which returns null or errors.
  • Applying a formula that references a column not yet loaded, such as a column created later in the query steps.
  • Not checking the output data type — e.g., setting a decimal result as Whole Number causes rounding errors.

Tips

  • Use the View > Formula Bar option to see the M code as you type — this helps you learn the syntax.
  • For complex logic, break it into multiple custom columns: create intermediate steps (e.g., first calculate subtotal, then apply tax).
  • Use the if statement to handle conditional logic: if [Sales] > 1000 then "High" else "Low".
  • Always test your formula on a small subset of data before applying it to thousands of rows.
  • Use the Column from Examples option (under Add Column) if you’re unsure of the formula — just provide 2–3 example values and Power BI will auto-generate the pattern.
  • After creating a custom column, sort your table by it to spot anomalies like unexpected nulls or duplicates.

Troubleshooting

  • If the column shows #value, check for incompatible data types — e.g., trying to multiply text. Use Number.From([Column]) to convert text to number if safe.
  • If you see #null, one of the referenced columns may have missing data. Use if [Column] = null then 0 else [Column] to substitute nulls.
  • If the formula is rejected with a syntax error, double-check parentheses, quotes, and operators. M language is strict: + for numbers, & for text.
  • If the column doesn’t appear after clicking OK, check that you typed a non-empty name and selected a valid output type.
  • If changes disappear after clicking Close & Apply, you may have reverted to an earlier query step. Use the Applied Steps pane on the right to verify your custom column is listed there.
  • For performance issues with large datasets, avoid complex nested logic; consider pre-calculating in the source database if possible.

Frequently Asked Questions

Can I reference a custom column in another custom column?

Yes, but only if the first column is created earlier in the Applied Steps list. Power Query processes steps sequentially, so later columns can depend on earlier ones.

Do custom columns affect my original data?

No. Custom columns are transformations applied only in Power BI’s query engine. Your source file (Excel, CSV, etc.) remains unchanged.

Can I delete a custom column later?

Yes. Right-click the column header in Power Query Editor and select Remove. The column will disappear from the dataset and any visuals using it.

Why does my custom column show different values than Excel?

Power BI may handle data types differently — e.g., Excel treats "12.5" as text, but Power BI may auto-convert it to number. Ensure data types match in both sources.

Can I use custom columns to create date calculations like "days since last order"?

Yes. Use Date.From([OrderDate]) and subtract from Date.From(DateTime.LocalNow()). Format the result as a whole number.

Is there a limit to how many custom columns I can add?

There’s no hard limit, but too many can slow down query refreshes. Aim for essential calculations only — avoid redundancy.