Forum Discussion

lecasuso's avatar
lecasuso
New Member
7 years ago
Solved

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 Reply