cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Field sorting in loading script

I have load 4 tables from google analytics with idetntial fields.

i need to union this tables and work with union data, but field's sorting in one table is differ from other: http://joxi.ru/vAWDOn6S1kNabr

 

Why and how fix this trouble?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Field sorting in loading script

Hi @serjio,

 

You can try to use below methods to merge tables.

 

1. Power query:Table.SelectColumns ,Table.Combine

 

Sample:

MergeTable= 
Table.Combine(
Table.SelectColumns(Table1,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table2,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table3,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table4,{"Column1","Column2","Column3"}))

 

 

2. Dax formula. Selectcolumns,  union functions.

 

Sample formula:

 

Table 2 = UNION(
	SELECTCOLUMNS('Table',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table2',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table3',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table3',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3])
	)

 

 

Reference links:

 

Dax:

SELECTCOLUMNS Function (DAX)

UNION Function (DAX)

 

Power query:

Table.SelectColumns

Table.Combine

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Field sorting in loading script

Hi @serjio,

 

You can try to use below methods to merge tables.

 

1. Power query:Table.SelectColumns ,Table.Combine

 

Sample:

MergeTable= 
Table.Combine(
Table.SelectColumns(Table1,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table2,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table3,{"Column1","Column2","Column3"}),
Table.SelectColumns(Table4,{"Column1","Column2","Column3"}))

 

 

2. Dax formula. Selectcolumns,  union functions.

 

Sample formula:

 

Table 2 = UNION(
	SELECTCOLUMNS('Table',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table2',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table3',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3]),
	SELECTCOLUMNS('Table3',"Column1",[Column1],"Column2",[Column2],"Column3",[Column3])
	)

 

 

Reference links:

 

Dax:

SELECTCOLUMNS Function (DAX)

UNION Function (DAX)

 

Power query:

Table.SelectColumns

Table.Combine

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Resident Rockstar
Resident Rockstar

Re: Field sorting in loading script

Cool,

 

We have to in Power Query. but we can do in DAX also. but in DAX it will createing Performance Issue.

 

So best way is go with Power Query.

 

SO we have option to Append your four table and create new table. follow the below steps1.JPG

 

 

 

 

 

Let me know if any help

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors