Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mrothschild
Continued Contributor
Continued Contributor

Virtual tables and not enough memory

Is there a more efficient way to program the following?  I'm getting error messages about not enough memory.

 

Table = 

VAR N = 100
VAR _Parent_Table = 
    ADDCOLUMNS (
        GENERATE(
            GENERATE(
                SELECTCOLUMNS ( GENERATESERIES ( 0, N , 1), "Equities", [Value] ),
                SELECTCOLUMNS ( GENERATESERIES ( 0, [Equities] , 1 ), "Public", [Value] )  
                ),             
            SELECTCOLUMNS( GENERATESERIES( 0, [Equities], 1 ) , "Private", [Value] )
        )
        ,
        "% Equity - Total",  [Equities] / N ,
            "% Equity - Public",  [Public] / N,  
            "% Equity - Private",  [Private] / N
    )

VAR _Child_Public_Table = 
    ADDCOLUMNS (
        GENERATE(
                     GENERATE(
                        _Parent_Table,
                        SELECTCOLUMNS( GENERATESERIES( 0, [Public], 1 ) , "S&P500", [Value] )
                    ),
                    SELECTCOLUMNS( GENERATESERIES( 0, [Public], 1 ) , "MSCI World", [Value] )
                )
        
        ,
        
            "% Equity - Public - S&P500",  [S&P500] / N,  
            "% Equity - Public - MSCI World",  [MSCI World] / N
 

    )

VAR _Child_Private_Table = 
    ADDCOLUMNS (
        GENERATE(
                     GENERATE(
                        _Child_Public_Table,
                        SELECTCOLUMNS( GENERATESERIES( 0, [Private], 1 ) , "Cambridge", [Value] )
                    ),
                    SELECTCOLUMNS( GENERATESERIES( 0, [Private], 1 ) , "TRPIEX", [Value] )
                )
        
        ,
        
            "% Equity - Private - Cambridge PE",  [Cambridge] / N,  
            "% Equity - Private - TRPIEX",  [TRPIEX] / N
 

    )

RETURN
_Child_Private_Table

 

The intended output is a new calculated table with 14 columns:

% Equity - Private

% Equity - Private - Cambridge PE

% Equity - Private - TRPIEX

% Equity - Public

% Equity - Public - MSCI World

% Equity - Public - S&P500

% Equity - Total 

Equities

Cambridge

MSCI World

Private

Public

S&P500

TRPIEX

1 REPLY 1
lbendlin
Super User
Super User

Not sure what you expect - you are raising 100 to the power of 7 (roughly, since you have some shorter runs).  That means  you ask to generate 100 trillion rows. Even one trillion rows would still be too much.

 

What's the goal behind this exercise?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.