UNION Function (DAX)

How does the UNION function (DAX) work?

UNION function (DAX) is where a union (join) table is formed from a pair of tables.

UNION Formula Syntax

UNION(<table_expression1>, <table_expression2>, [, <table_expression>]

How do you use the UNION function?

The two tables must have the same number of columns.

Columns are combined by position in their respective tables.

Related Blog Posts

Using-Filter-Fields-Visual-Interactions-To-Create-Compelling-Visualizations-In-Power-BI

Related Support Forum Posts

Difference between union and append
Advanced Table Functions: UNION
How To Create Tables Combining UNION & ROW Function – Power BI & DAX

Considerations when using the UNION function

The column names in the return table will match the column names in table_expression1.

Duplicate rows are retained.

The returned table has lineage where possible. For example, if the first column of each table_expression has lineage to the same base column C1 in the model, the first column in the UNION result will have lineage to C1. However, if combined columns have lineage to different base columns, or if there is an extension column, the resulting column in UNION will have no lineage.

When data types differ, the resulting data type is determined based on the rules for data type coercion.

The returned table will not contain columns from related tables.

Related Video Tutorials

How-To-Create-Tables-Combining-UNION-ROW-Function-Power-BI-DAX
Using-The-CROSSJOIN-Function-In-Power-BI-DAX-Concepts
Dynamically-Compare-Monthly-Information-Cumulatively-in-Power-BI-w-DAX-1

Formula examples using the UNION function

UNION(UsaInventory, IndInventory)

Related DAX Functions

ceiling
ROUND
ROUNDUP

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership