DAX Other - UNION function


Advertisements

Description

Creates a union (join) table from the specified tables.

DAX UNION function is new in Excel 2016.

Syntax

UNION (<table_expression1>, <table_expression2>, [<table_expression3>] …) 

Parameters

Sr.No. Parameter & Description
1

table_expression

Any DAX expression that returns a table.

Return Value

A table that contains all the rows from each of the table expressions.

Remarks

  • The tables must have the same number of columns.

  • Columns are combined by the position in their respective tables.

  • 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 a 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.

Example

= SUMX (UNION (SalesOldData, SalesNewData), [Sales Amount]) 
dax_functions_other.htm

Useful Video Courses


Video

Mastering DAX and Data Models in Power BI Desktop

53 Lectures 5.5 hours

Abhay Gadiya

Video

Mastering DAX Studio

Featured

24 Lectures 2 hours

Randy Minder

Video

DAX / Power BI - Customer and Sales Analysis Deep Dive

26 Lectures 4.5 hours

Randy Minder

Advertisements