Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jcastr02
Post Prodigy
Post Prodigy

Combining certain columns from different queries

I have certain columns from 3 different queries where Im asking an NPS Question - 1 table is from 30 day , 1 table is from 60 day, and 1 table is from 90 day.   How can I combine or append these columsn so I can get an overall Rating score, but I'd also like the new rows to be labeled 30,60,90 so I know from which time period it's coming.  combining NPS.png

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @jcastr02 

 

Based on your description, I created data as follows.

a1.png

a2.png

 

You can click 'Edit Query', go to Query Editor, create a new Query, input the following codes in the 'Advanced Editor'.

 

let
    Source = Table.Combine({Table.AddColumn(Table1,"From",each "Table1"), Table.AddColumn(#"Table 2","From",each "Table2")})
in
    Source

 

a3.png

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @jcastr02 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @jcastr02 

 

Based on your description, I created data as follows.

a1.png

a2.png

 

You can click 'Edit Query', go to Query Editor, create a new Query, input the following codes in the 'Advanced Editor'.

 

let
    Source = Table.Combine({Table.AddColumn(Table1,"From",each "Table1"), Table.AddColumn(#"Table 2","From",each "Table2")})
in
    Source

 

a3.png

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

rainer1
Resolver III
Resolver III

Hi,

 

you can achieve this in the query editor.

 

queries.png

 

 

First, if you want to have a lable label you have to generate a new column in the queries editor.

 

Go to the tab Custom Column then in the ribbon click custom Column.

Specifiy the name of the custom Column. The formula is simple like in the picture. Dont forget the quotes.

 

 

After you edit your three tables you can do the append of them.

 

You can find the Append Button under the Home tab in right corner.

 

sample2.PNG

 

Click Append Choose  Two or more Tables add them to the left and hit ok.

Append.png

 

Now your data is in one Table with a identifier.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.