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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Antoinette123
Helper I
Helper I

After combining 2 tables got something strange

I have a column "Name", in which each value is repeated twice. And each value has its own share (input data). I need to calculate the average share among the first occurrence of values in the first column, and the average for the second occurrence, for each subgroup (the subgroups are distinguished by the first part of the name: like input car 1, car 1, car 2, car 2, bike 1, bike 1, bike 2, bike 2, etc (word + number). An example is shown in the figure. I already created an occurrence index.
Antoinette123_0-1724979921443.png

 To solve the task, I used "group by" and most of my columns disappeared in the new table. And when I try to merge the tables, I get strange results with many rows being repeated million times. How can I do it properly in Power Query? The data is in the comment under the post.

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

Hi @Antoinette123 

 

For your question, here is the method I provided:

 

You need an Original table and add a Copy table.

 

“Original table”

 

vnuocmsft_0-1725242572054.png

“Copy table”

 

vnuocmsft_0-1725242572054.png

 

First, the Copy table is group by.

 

vnuocmsft_2-1725242783955.png

 

The original and copy tables are then merged. You can choose to merge a new table.

 

vnuocmsft_3-1725242869079.png

 

vnuocmsft_4-1725242937743.png

 

Here is the result.

 

vnuocmsft_5-1725242991330.png

 

Regards,

Nono Chen

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

2 REPLIES 2
v-nuoc-msft
Community Support
Community Support

Hi @Antoinette123 

 

For your question, here is the method I provided:

 

You need an Original table and add a Copy table.

 

“Original table”

 

vnuocmsft_0-1725242572054.png

“Copy table”

 

vnuocmsft_0-1725242572054.png

 

First, the Copy table is group by.

 

vnuocmsft_2-1725242783955.png

 

The original and copy tables are then merged. You can choose to merge a new table.

 

vnuocmsft_3-1725242869079.png

 

vnuocmsft_4-1725242937743.png

 

Here is the result.

 

vnuocmsft_5-1725242991330.png

 

Regards,

Nono Chen

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

 

 

 

 

 

 

 

Antoinette123
Helper I
Helper I

Data:

   
OwnerNameShareIndexWhat I need ->OwnerNameShareIndexAverage share
BobCar 10,451 BobCar 10,451(0,45+0,4)/2
BobCar 10,552 BobCar 10,552(0,55+0,6)/2
BobCar 20,41 BobCar 20,41(0,45+0,4)/2
BobCar 20,62 BobCar 20,62(0,55+0,6)/2
AlexBike 10,31 AlexBike 10,31(0,3+0,2)/2
AlexBike 10,72 AlexBike 10,72(0,7+0,8)/2
AlexBike 20,21 AlexBike 20,21(0,3+0,2)/2
AlexBike 20,82 AlexBike 20,82(0,7+0,8)/2

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.