Power BI Table Expression: A How-To Guide
In this article
A Power BI table expression is a formula written in DAX (Data Analysis Expressions) that returns a table rather than a single value. You use it to create calculated tables, define virtual tables inside measures, or supply tables to functions like FILTER and SUMMARIZE. The shortest working approach is to open the Modeling tab, choose New table, and enter a DAX expression such as Sales2024 = FILTER(Sales, Sales[Year] = 2024). That creates a calculated table that is stored in the model and refreshed with your data source.
What You'll Need
- Power BI Desktop installed (the steps below refer to the desktop app; the Power BI service has a more limited formula experience).
- A data model with at least one table loaded, ideally with clear column names.
- Basic familiarity with DAX syntax, especially table and column references in square brackets.
- Edit permissions on the report if you are working in a shared workspace.
Step-by-Step
- Open your report in Power BI Desktop and make sure the data you want to work with is already loaded. Calculated tables are built from tables that exist in the model, so load your source tables first.
- Go to the Modeling tab on the ribbon. The exact label can differ slightly by version, but the New table command sits in the calculations area of that tab.
- Click New table. A formula bar appears where you type the DAX expression. The editor expects the pattern
TableName = <table expression>. The name on the left becomes the name of your new calculated table. - Write a table expression. Start with a function that returns a table. Common choices are
FILTER,SUMMARIZE,SELECTCOLUMNS,ADDCOLUMNS,UNION, andDISTINCT. For example:HighValueOrders = FILTER(Orders, Orders[Amount] > 1000). - Reference columns correctly. Use the table name followed by the column in brackets, such as
Orders[Amount]. If a column name contains spaces, keep the brackets. Do not wrap the whole reference in quotes. - Press Enter or click the checkmark to commit the formula. Power BI validates the expression and, if it is valid, adds the new table to the Fields pane.
- Check the result in Data view. Switch to the Data view and select your new table. Confirm the rows and columns match what you intended. Calculated tables are materialized, so they store the result in the model.
- Use the table in visuals or measures. You can drag fields from the calculated table onto a report canvas, or reference it inside a measure with functions like
COUNTROWSorSUMX. - Save and refresh. Calculated tables recalculate when the model refreshes. If the underlying data changes, refresh the dataset to update the table. In Power BI Desktop, use Home > Refresh.
Common Mistakes
- Returning a single value instead of a table. Expressions like
SUM(Sales[Amount])return a scalar. A calculated table needs a table-returning function. Wrap scalar logic inADDCOLUMNSorROWif you need a one-row table. - Forgetting the table name and equals sign. The formula bar expects
Name = Expression. Omitting the name produces a syntax error. - Using a column reference without the table name. In a calculated table,
[Amount]alone is ambiguous if more than one table has that column. Always qualify it. - Assuming calculated tables are dynamic in visuals. They are computed at refresh time, not at visual render time. If you need a table that changes with slicer selections, use a measure with a table expression inside it instead.
- Building a calculated table when a measure would do. Calculated tables increase model size. For aggregations used only in visuals, a measure is usually lighter.
Tips
- Use
SUMMARIZEorSUMMARIZECOLUMNSto create grouped summary tables, then relate them to your fact tables if needed. - Name calculated tables clearly, for example with a prefix like
Calc_, so report authors know they are derived. - Test expressions in DAX Studio or the formula bar before committing if the logic is complex.
- Keep calculated tables small where possible. Large materialized tables slow refresh and increase file size.
- Use
SELECTCOLUMNSto trim a table to only the columns you need, which reduces model bloat.
Troubleshooting
If the formula bar shows a red error, read the message carefully. Common causes are a missing table name, a misspelled function, or a column that does not exist in the model. Check the exact spelling in the Fields pane.
If the table is created but empty, your filter condition may not match any rows. Test the same filter in a simple CALCULATE measure to see whether rows exist. Also confirm that relationships are active if you are relying on related tables.
If the table appears but shows unexpected columns, review the function you used. FILTER returns all columns of the input table; SELECTCOLUMNS returns only the columns you list. Use the latter when you want a narrow table.
If refresh fails after adding the table, check that the source columns still exist. Renaming a column in the source breaks the DAX reference. Update the expression to match the new name.
If you cannot find New table, confirm you are in Power BI Desktop and not the service. The service offers a more limited modeling experience, and some table-creation options are only available in Desktop.
Frequently Asked Questions
What is the difference between a calculated table and a measure?
A calculated table is materialized in the model and stores rows. A measure is evaluated at query time and returns a single value. Use a calculated table when you need a reusable table object; use a measure for dynamic aggregations.
Can I use a table expression inside a measure?
Yes. Functions like SUMX, COUNTROWS, and FILTER accept table expressions. For example, COUNTROWS(FILTER(Sales, Sales[Amount] > 100)) returns a count based on a virtual table.
Do calculated tables refresh automatically?
They recalculate when the dataset refreshes. In Power BI Desktop, use Home > Refresh. In the service, scheduled refresh updates them according to your refresh settings.
Why does my calculated table show a relationship error?
Calculated tables do not automatically inherit relationships. If you need relationships, create them manually in Model view, or build the table from an existing table that already has them.
Can I delete a calculated table?
Yes. Right-click the table in the Fields pane and choose Delete. This removes the table and any visuals that depend on it will break, so check dependencies first.
Is DAX the only way to create a table expression?
In Power BI, DAX is the language for calculated tables. Power Query (M) is used earlier in the process to shape tables before they load, but it does not create model-level calculated tables.