DAX Aggregation - GENERATEALL function



Description

Returns a table with the Cartesian product between each row in table1 and the table that results from evaluating table2 in the context of the current row from table1.

Syntax

GENERATEALL (<table1>, <table2>) 

Parameters

Sr.No. Parameter & Description
1

table1

Table or a DAX expression that returns a table.

2

table2

Table or a DAX expression that returns a table.

Return Value

Returns a table with the Cartesian product between each row in table1 and the table that results from evaluating table2 in the context of the current row from table1.

Remarks

  • If the evaluation of table2 for the current row in table1 returns an empty table, then the current row from table1 will be included in the results, and columns corresponding to table2 will have null values for that row. This is different than GENERATE () where the current row from table1 will not be included in the results in such a case.

  • All column names from table1 and table2 must be different or an error is returned.

Example

= GENERATEALL ( 
   SUMMARIZE(Salesperson,Salesperson[Salesperson]),
      SUMMARIZE(SalesTarget,SalesTarget[SalesTarget],
      "MaxTarget",MAX(Sales Target[SalesTarget]))
) 
dax_functions_aggregation.htm
Advertisements