Forum Discussion

nadav50's avatar
nadav50
Regular Visitor
9 years ago
Solved

creating table from multiple other columns

hi ,

i added a pic that im trying to do in power bi but not succeed,

 

hope you understand :)

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hit the New Table button and add this DAX formula:

     

    new table = ADDCOLUMNS(
    	NATURALINNERJOIN(
    		'Table 1',
    		SUMMARIZE(
    			'Table 2',
    			'Table 2'[closing balance]
    		)
    	),
    	"sum balance",
    	'Table 1'[opening balance] + 'Table 2'[closing balance]
    )

     

    Note that you need to have a relationship between the two source tables. Also if your real data is not quite like this sample data, you may have to use NATURALLEFTOUTERJOIN instead. Depends on whether or not one of the two tables has blanks or duplicates.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hit the New Table button and add this DAX formula:

     

    new table = ADDCOLUMNS(
    	NATURALINNERJOIN(
    		'Table 1',
    		SUMMARIZE(
    			'Table 2',
    			'Table 2'[closing balance]
    		)
    	),
    	"sum balance",
    	'Table 1'[opening balance] + 'Table 2'[closing balance]
    )

     

    Note that you need to have a relationship between the two source tables. Also if your real data is not quite like this sample data, you may have to use NATURALLEFTOUTERJOIN instead. Depends on whether or not one of the two tables has blanks or duplicates.

      • Anonymous's avatar
        Anonymous
        Not applicable

        efglynnUnder the Modeling tab in the ribbon.