cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fcoatis Helper V
Helper V

ADDCOLUMNS

I need help with this one:

Can  I calculate a third column from the two just created?

Category Budget = 
    ADDCOLUMNS(
        CROSSJOIN(SUMMARIZECOLUMNS('Product Category'[Category]);DISTINCT('Date'[Month]));
        "2009 Sales"; CALCULATE([Sales Amount];'Date'[Calendar Year Number]=2009);
        "Factor" ; LOOKUPVALUE('Product Category'[Budget];'Product Category'[Category];[Category])/*;
        "Budget 2010"; [2009 Sales] * [Factor]*/
    )

Capturar.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: ADDCOLUMNS

Hi @Fcoatis 

Yes, you just need an additional ADDCOLUMNS:

Category Budget =
ADDCOLUMNS (
    ADDCOLUMNS (
        CROSSJOIN (
            SUMMARIZECOLUMNS ( 'Product Category'[Category] );
            DISTINCT ( 'Date'[Month] )
        );
        "2009 Sales"; CALCULATE ( [Sales Amount]; 'Date'[Calendar Year Number] = 2009 );
        "Factor"; LOOKUPVALUE (
            'Product Category'[Budget];
            'Product Category'[Category]; [Category]
        )
    );
    "Extra column"; [Factor] * [2009 Sales]
)

I've set the product of the two columns as example

View solution in original post

2 REPLIES 2
Highlighted
Super User III
Super User III

Re: ADDCOLUMNS

Hi @Fcoatis 

Yes, you just need an additional ADDCOLUMNS:

Category Budget =
ADDCOLUMNS (
    ADDCOLUMNS (
        CROSSJOIN (
            SUMMARIZECOLUMNS ( 'Product Category'[Category] );
            DISTINCT ( 'Date'[Month] )
        );
        "2009 Sales"; CALCULATE ( [Sales Amount]; 'Date'[Calendar Year Number] = 2009 );
        "Factor"; LOOKUPVALUE (
            'Product Category'[Budget];
            'Product Category'[Category]; [Category]
        )
    );
    "Extra column"; [Factor] * [2009 Sales]
)

I've set the product of the two columns as example

View solution in original post

Fcoatis Helper V
Helper V

Re: ADDCOLUMNS

@AlB Thank you very much

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors