NATURALINNERJOIN in DAX: Combining Two Tables Using Common Columns

September 23, 2026 88 visits

In this article, we will learn how to use NATURALINNERJOIN in DAX to combine two tables based on their common columns. We will also learn how to use SELECTCOLUMNS with NATURALINNERJOIN to return only the columns required in the final result.

📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist

What Is NATURALINNERJOIN in DAX?

NATURALINNERJOIN combines two tables by matching columns that have the same column name and compatible data types. It returns only the rows where a matching value exists in both tables.

Conceptually, an inner join looks for records that exist in both tables:

Table 1 Common Column Table 2
students_natural Matching common column payments
Key takeaway:
NATURALINNERJOIN automatically identifies the common columns used for the join. You do not explicitly specify a join condition inside the function.

1. NATURALINNERJOIN – Combine Two Tables

Query

DAX Query
EVALUATE
    NATURALINNERJOIN(
        students_natural,
        payments
    )

Step-by-step explanation

Step 1: EVALUATE
EVALUATE is used to return the result of a table expression from a DAX query.

Step 2: NATURALINNERJOIN
NATURALINNERJOIN combines the two supplied tables and returns the matching rows.

Step 3: students_natural
This is the first table used in the join.

Step 4: payments
This is the second table used in the join.

Step 5: Matching common columns
DAX looks for columns with the same name in both tables and uses the compatible common columns to perform the natural inner join.

What will you get?

The result contains rows that have matching values in the join column or columns in both students_natural and payments.

For example, if both tables contain a common column such as StudentID, only students with matching payment records will appear in the result.

StudentID Name Paid
101 Arun 5000
102 Priya 4500
104 Karthik 5000

The table above is only an illustration. Your actual result depends on the columns and data available in the practice tables.

Key takeaway:
NATURALINNERJOIN returns only the matching records from the two tables based on their common columns.

2. NATURALINNERJOIN with SELECTCOLUMNS

Sometimes we do not need every column from the joined result. In that situation, we can combine NATURALINNERJOIN with SELECTCOLUMNS to return only the required columns.

Query

DAX Query
EVALUATE
    SELECTCOLUMNS(
        NATURALINNERJOIN(
            students_natural,
            payments
        ),
        [Name],
        [Paid]
    )

Step-by-step explanation

Step 1: EVALUATE
EVALUATE returns the final table expression produced by the query.

Step 2: NATURALINNERJOIN
The inner join first combines students_natural and payments using their common columns.

Step 3: SELECTCOLUMNS
SELECTCOLUMNS takes the joined table expression and creates an output containing only the columns specified in the query.

Step 4: [Name]
The Name column is selected from the joined result.

Step 5: [Paid]
The Paid column is selected from the joined result.

What will you get?

Instead of returning all columns produced by the join, the query returns only the Name and Paid columns.

Name Paid
Arun 5000
Priya 4500
Karthik 5000

The values above are illustrative. The actual result will depend on your practice data.

Key takeaway:
You can use SELECTCOLUMNS on top of NATURALINNERJOIN when you want to control which columns are returned by the final query.

Understanding the Query Flow

The second query can be understood as a two-stage operation:

  1. NATURALINNERJOIN combines the two tables and keeps matching rows.
  2. SELECTCOLUMNS takes that joined result and returns only the required columns.
Query Flow
students_natural
        +
     payments
        ↓
NATURALINNERJOIN
        ↓
Joined Table
        ↓
SELECTCOLUMNS
        ↓
Name + Paid

NATURALINNERJOIN vs SELECTCOLUMNS

Function Purpose
NATURALINNERJOIN Combines two tables using matching common columns and returns matching rows.
SELECTCOLUMNS Creates a table containing only the selected columns from a table expression.
NATURALINNERJOIN + SELECTCOLUMNS Joins the tables first and then returns only the required columns.

Important Notes

1. Common columns are important

NATURALINNERJOIN relies on columns that are common to both tables. The column names and data types must be compatible for the natural join to work as expected.

2. Only matching rows are returned

Because this is an inner join, rows without a matching value in the other table are not included in the result.

3. You do not specify the join condition

Unlike functions where you explicitly provide a left-side column and right-side column, NATURALINNERJOIN determines the common columns automatically.

4. SELECTCOLUMNS controls the final output

When the joined table contains more columns than you need, SELECTCOLUMNS can be used to create a smaller and more focused result.

📝 Practice Exercise

Try writing a DAX query that combines students_natural and payments using NATURALINNERJOIN and then returns only the following columns:

  • Name
  • Paid

Then modify the query to return another column from the joined result and observe how the output changes.

Conclusion

In this article, we learned how to combine two tables using NATURALINNERJOIN and how to control the final output using SELECTCOLUMNS.

  • NATURALINNERJOIN combines two tables using their common columns.
  • Only matching rows are returned because it performs an inner join.
  • The common columns used for the natural join are determined automatically.
  • SELECTCOLUMNS can be used after the join to return only the required columns.
  • Combining table functions is an important skill for writing DAX queries and exploring data in DAX Studio.

Next: Continue exploring DAX table functions to understand how different table expressions can be combined, filtered, and transformed.


📥 Practice Data:
Download Practice Data Free

🎥 Prefer learning through video?
DAX YouTube Playlist