cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Highlighted
Helper V
Helper V

Re: ADDCOLUMNS

@AlB Thank you very much

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors