04.1The calculated table

So far, you have written measures, which return a single value, like a number, a text or a date. The same formula bar also creates calculated tables and calculated columns. This lesson is about the calculated table.

04.1.1Three kinds of tables

You have already met the virtual table. In this measure, FILTER creates a table, the customers in New York, and COUNTROWS counts its rows:

New York Customers = COUNTROWS( FILTER( Customers, Customers[City] = "New York" ) )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table
In plain words

“I want the number of customers in New York.”

Here, the table from FILTER is an intermediate step. COUNTROWS counts its 3 rows, then the table disappears.

Power BI knows two other kinds of tables:

  • The physical table comes from the data imported into Power BI, from an Excel file or a database. Sales, Customers and Products are physical tables.
  • The calculated table is created by a DAX formula. It takes its place in the Data pane, next to the physical tables. But its rows are not imported. The formula builds them, often from other tables.

“Physical table” may sound odd, since you cannot touch a Power BI table. It is still the usual term, the one you will read most often.

04.1.2The same FILTER, two uses

The same piece of DAX can be used in two ways:

FILTER( Customers, Customers[City] = "New York" )
Power BI accepts this DAX forno, Measureno, Calculated columnyes, Calculated tableyes, Virtual table

In a measure, you wrap it in COUNTROWS. FILTER creates a virtual table, COUNTROWS counts its rows, then the table disappears:

New York Customers = COUNTROWS( FILTER( Customers, Customers[City] = "New York" ) )
Power BI accepts this DAX foryes, Measureyes, Calculated columnno, Calculated tableno, Virtual table
In plain words

“I want the number of customers in New York.”

The measure returns 3. The table of New York customers, on the other hand, shows up nowhere.

On its own, with the New table button, FILTER creates a calculated table:

New York Customers = FILTER( Customers, Customers[City] = "New York" )
Power BI accepts this DAX forno, Measureno, Calculated columnyes, Calculated tableyes, Virtual table
In plain words

“I want the table of the customers in New York only.”

Its 3 rows stay in Power BI. You can see them in Table view:

New York Customers = FILTER( Customers, Customers[City] = "New York" )
Table New York Customers
Customer IDNameTypeCity
C001OrvaneCompanyNew York
C002KumoraCompanyNew York
C003TalvioCompanyNew York
Table: New York Customers (3 rows)

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

The place where you create a formula does not change what it returns. The measure ends with a number, 3, because COUNTROWS wraps FILTER. The calculated table ends with a table, because FILTER stands alone. Written with New table, COUNTROWS( FILTER( Customers, Customers[City] = "New York" ) ) does not become a table. Power BI rejects it.

What the formula returns at the end decides whether the place of creation fits. Power BI does not judge the steps, it judges the final result. Each button expects its own:

  • New measure expects a single value.
  • New column expects a value on each row of the table.
  • New table expects a table.

In the measure that counts the New York customers, FILTER returns a table along the way. But COUNTROWS receives that table and ends with 3, a single value. Power BI accepts the measure. Written alone with New measure, FILTER( Customers, Customers[City] = "New York" ) would end with a table, and Power BI would reject it.

When Power BI rejects a formula that has no typo, its final result often does not match the button you chose. The formula is not written in the right place.

04.1.3Why create a calculated table?

Our data has three tables. Sales tells what happened, one row per sale. It is the fact table. Customers and Products describe the sales, with the customer who buys and the product sold. They are the dimension tables.

One table is missing, the date table. Sales does have a Date column, but days are missing from it. It holds only the days with a sale, 12 days over two years. Between January 15 and March 8, 2024, there is not a single row. February 2024 appears nowhere in Sales.

Some DAX functions compare one period with another. They are called time intelligence functions. Here are three of them:

Three time intelligence functions
Three time intelligence functions
FunctionWhat it returns
PREVIOUSMONTHThe days of the previous month
DATESYTDThe days since the start of the year
SAMEPERIODLASTYEARThe same days, one year earlier

A figure on its own says little. March revenue, compared with February or with March of last year, tells you whether sales are going up or down.

These functions need a table that holds every day, without missing a single one. If your data does not have one, you create it.

04.1.4Creating a calculated table, the calendar

You create this table in DAX, and you name it “Calendar.” Not in a measure, since a measure returns only a single value. Power BI has a button for this, New table, in the Table tools tab of Table view. In Report view, the same button sits in the Modeling tab.

The formula bar opens with “Table =.” Replace “Table” with the name of the new table, then write the formula after the “=” sign:

Calendar = CALENDARAUTO()
Power BI accepts this DAX forno, Measureno, Calculated columnyes, Calculated tableyes, Virtual table

Confirm with the check mark, to the left of the formula bar, or with the Enter key.

CALENDARAUTO takes no argument. It looks for dates in the tables. Here, only Sales has some, from January 15, 2024 to December 2, 2025. CALENDARAUTO then takes whole years, from January 1, 2024 to December 31, 2025, that is 731 days:

Calendar = CALENDARAUTO()
Table Calendar
Date
1/1/2024
1/2/2024
1/3/2024
1/4/2024
1/5/2024
1/6/2024
1/7/2024
1/8/2024
1/9/2024
1/10/2024
1/11/2024
1/12/2024
1/13/2024
1/14/2024
1/15/2024
1/16/2024
1/17/2024
1/18/2024
1/19/2024
1/20/2024
1/21/2024
1/22/2024
1/23/2024
1/24/2024
Table: Calendar (731 rows)

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

Tip

Without an argument, CALENDARAUTO counts a year from January to December. If your fiscal year ends in another month, give the number of that month as the argument. With CALENDARAUTO( 6 ), each year runs from July to June. Our sales then cover three fiscal years, and the table runs from July 1, 2023 to June 30, 2026, that is 1,096 days.

One step remains, and it is strongly recommended. Tell Power BI that Calendar really is a date table. In Model view, click the … button at the top right of the table, then Mark as date table. In the window that opens, turn on the toggle, then choose the Date column. Power BI checks that each date appears only once and that no day is missing, and the time intelligence functions can then rely on it. When the relationship with Sales goes through a column of type Date, as here, the time functions most often return the right results without it already, and marking the table stays a safety measure, one that Microsoft requires for these functions. When the relationship goes through another column, a number like 20250131 for example, marking the table becomes essential.

The table follows the data. When sales from 2026 arrive, CALENDARAUTO will add the year 2026 at the next data refresh.

For now, Calendar has only one column, Date. It is still a real table, since a table can have just one column. Later, you will add the month, the week, the quarter and the year to it, either in its formula with ADDCOLUMNS, or in the Power BI interface, with the New column button. You will then be able to study sales month by month, or quarter by quarter.

The calendar is the most common calculated table, but not the only one. You will also create some, among other things, to combine two tables or to summarize a large table.

See other examples

Combining two tables. Your 2024 sales and your 2025 sales come in two separate files, so in two tables. UNION puts them end to end:

All Sales = UNION( 'Sales 2024', 'Sales 2025' )
Power BI accepts this DAX forno, Measureno, Calculated columnyes, Calculated tableyes, Virtual table

You get a single table, with the rows of both years. Both tables must have the same number of columns, and UNION matches them in their order. So keep them in the same order.

Summarizing a large table. Sales has one row per sale. To get one row per customer, with the total of their purchases:

Sales per Customer = ADDCOLUMNS( SUMMARIZE( Sales, Sales[Customer ID] ), "Total", [Revenue] )
Power BI accepts this DAX forno, Measureno, Calculated columnyes, Calculated tableyes, Virtual table
In plain words

“I want the list of the customers found in the sales, with a “Total” column next to each one holding their revenue.”

Sales per Customer = ADDCOLUMNS( SUMMARIZE( Sales, Sales[Customer ID] ), "Total", [Revenue] )
Table Sales per Customer
Customer IDTotal
C001450,000
C002300,000
C003150,000
C004250,000
C005250,000
C006200,000
C007100,000
Table: Sales per Customer (7 rows)

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

You get 7 rows, one per customer. This case is often better handled with a measure, as the end of this lesson shows.

Any function that returns a table can be used in a calculated table. Here are the most common ones.

Functions that create a table
Functions that create a table
FunctionWhat it returns
CALENDARA date table, one day per row, between two dates
CALENDARAUTOThe same, with the dates found in your tables
FILTERThe rows of a table that meet a condition
VALUES and DISTINCTThe values of a column, each one only once
SUMMARIZEOne row for each value of the chosen columns
ADDCOLUMNSA table, with one or more extra columns
UNIONSeveral tables put end to end
{ } and DATATABLEA table written by hand, value by value
Practice

Each exercise is solved with the function you just discovered. Two exercises per function, a direct use and a combined use, from easiest to hardest, on data other than the course data. Pick the right formula out of five.

  1. Direct useCalculated tableDifficulty

    A library has only one table with dates, “Loans.” Create the calculated table “Days,” one day per row, over the whole years of its loans.

    Loans
    BookDate
    Dune2/3/2025
    Emma6/17/2025
    Ulysses11/28/2026

    Which formula should you write for “Days”?

  2. Combined useCalculated tableDifficulty

    A school has only one table with dates, “Enrollments.” Its school year ends in August. Create the calculated table “Days,” one day per row, over the whole school years.

    Enrollments
    StudentDate
    Alma9/2/2025
    Bilal1/15/2026
    Chloé6/30/2026

04.1.5A table like the others

Like Customers and Products, Calendar must be linked to the fact table, Sales. The Date column of Calendar meets every condition of a primary key, each date in it is unique and none is blank. So it is the one that makes the link, with the Date column of Sales.

After that, you use Calendar like a physical table. You place its columns in a visual or in a slicer, and you name it in formulas. In visuals and formulas, Power BI treats it like the other tables. Only its origin differs, a formula rather than imported data.

If your time calculations stay blank or look wrong, check these three points first. The date table holds every day, it is marked as a date table, and it is linked to Sales.

It is calculated at data refresh, then kept as it is, like the rows of a physical table. A slicer or a click in a visual does not change its rows.

Its rows are stored in the file, like those of a physical table. So it takes up memory. Calendar, with its 731 rows and its single column, weighs almost nothing. A calculated table drawn from a very large table, on the other hand, can make the file heavier. So create one only if you need it.

04.1.6A measure rather than a calculated table?

In many cases, a measure is better than a calculated table. Take the summary of sales per customer. A calculated table gives the total of each customer once and for all. The “Revenue” measure, placed in a visual next to the customers, gives the same totals. But its result follows the filters, and it takes up no memory.

The calculated table often looks like the simplest solution when you are not yet comfortable with DAX. You see its rows, and you can check them one by one. Before creating one, ask yourself whether a measure would do the job.

For every choice you make in Power BI, keep the size of the file in mind. The heavier the file, the slower the report. You click a slicer, and the visuals take several seconds to update. The report lags, for you and for everyone who opens it.

The calendar, however, is an exception. It is a table apart, and a very important one, that no measure replaces.

Quiz

The questions often rely on the course tables. Keep them in view in their floating window, which you can move and enlarge.

Question 1

With the New table button, you write New York Customers = COUNTROWS( FILTER( Customers, Customers[City] = "New York" ) ). What happens?

Question 2

Calendar is created with Calendar = CALENDARAUTO(). A sale dated 2/10/2026 arrives in Sales. After the data refresh, up to what date does Calendar run?

Question 3

The calculated table Sales per Customer = ADDCOLUMNS( SUMMARIZE( Sales, Sales[Customer ID] ), "Total", [Revenue] ) returns 450,000 for C001. A date slicer keeps the year 2025. What does the “Total” column hold for C001?

Key takeaways
  • The formula bar creates measures, calculated columns and calculated tables. The same formula, like FILTER, returns a virtual table in a measure and a calculated table with the New table button.
  • A physical table comes from imported data. A calculated table comes from a DAX formula. A virtual table exists only for the duration of a calculation.
  • A calculated table does not change with the filters and takes up memory. In many cases, a measure is better.
  • The calendar is the exception. You can create it with CALENDARAUTO(), mark it as a date table, then link it to Sales through the Date column.