Home » DAX » DAX – UNION function

DAX – UNION function

Power Bi Union Example

The UNION function is a DAX function in Power BI that is used to combine rows from two or more tables, falling under the Table Manipulation DAX Functions category.

Refer similar DAX Post – EXCEPTINTERSECT

Points to be remember:

  • The tables should be same number of columns.
  • Columns are combined by position in their respective tables.
  • The column names in the return table will match the column names in the first Table.
  • It returns the all tables rows, including duplicate rows.




Syntax:

UNION ( <Table 1>, <Table 2> …. ,<table N>)

Description:

S no. Parameter Description
1 table name A table that will participate in the union and it is repeatable.

Let’s start with an example

Step-1: Two sample tables with data as below

Step-2: Go to Modeling Tab, click on New Table

How to take New Table in Power Bi

How to take New Table in Power Bi

Step 3: After the DAX formula screen appears, write the following query below:

Table_1: First table name

Table_2: Second table name

Union_Result = UNION(Table_1,Table_2)
Union Query

Union Query




Step 4: Returns the output as a new table(Union_Result).

table 3

Refer similar DAX Post – EXCEPTINTERSECT

Hope you enjoyed the post. Your valuable feedback, question, or comments about this post are always welcome or you can leave us message on our contact form , we will revert to you asap.

Recommended Power BI Post:

DATATABLE

ALLSELECTED

ALL

ADDCOLUMNS




Leave a Reply