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

Get column value corresponding to another column value in Table.Group

Lets say that I have a table like this in M language:

 

ABC
125X
218Y
120Z
123W

 

I want to group the rows by A and get the min of B from each group, but I also need the corresponding C value of the resulting B. This would be the resulting table in this case:

 

AMinBCorrespondingC
120Z
218Y

 

As you can note, from the rows with value 1 in column A, 20 is the min value of B, and Z is the corresponding value of 20 in column C.

 

I have been looking for a while but I haven't found a solution for this in M language. I have to do find corresponding values for several aggregations so I want to know if there is any commun procedure, or some at least, to solve this.

Thanks in advance,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get column value corresponding to another column value in Table.Group

@lecasuso,

 

You may follow steps below:

 

1. Duplicate the table, then click Transform-> Group By to general table below:

 1.PNG2.PNG 

 

2. Merge the two tables and remove some useless columns:

3.PNG4.PNG 

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
Community Support Team
Community Support Team

Re: Get column value corresponding to another column value in Table.Group

@lecasuso,

 

You may follow steps below:

 

1. Duplicate the table, then click Transform-> Group By to general table below:

 1.PNG2.PNG 

 

2. Merge the two tables and remove some useless columns:

3.PNG4.PNG 

 

Community Support Team _ Jimmy Tao

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

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (4,279)