DAX Aggregation - GENERATEALL function


Advertisements

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

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