cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

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 🙂

new table.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User I
Super User I

Re: creating table from multiple other columns

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Highlighted
Super User I
Super User I

Re: creating table from multiple other columns

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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Advocate III
Advocate III

Re: creating table from multiple other columns

So where is the "New Table" button?

Highlighted
Super User I
Super User I

Re: creating table from multiple other columns

@efglynnUnder the Modeling tab in the ribbon.

 

NewTable.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Community Champion
Community Champion

Re: creating table from multiple other columns

@nadav50@efglynn

 

Frankly I'm surprised @KHorseman offered a DAX solution Smiley Very Happy maybe because this was last year

 

I think the Query Editor is made for this!

 

Look at these 2 links describing all the joins and select which one you need in your case

http://www.excelguru.ca/blog/2015/12/16/merge-tables-using-outer-joins-in-power-query/

http://www.excelguru.ca/blog/2015/12/23/merge-tables-using-inner-and-anti-joins-in-power-query/

 

Once you know which join type you need its really easy to do in the Query Editor Smiley Happy

 

Query Editor - Merge As New.gif

Highlighted
Regular Visitor

Re: creating table from multiple other columns

Amazing!! THX

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors