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
lecasuso
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
v-yuta-msft
Community Support
Community Support

@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
v-yuta-msft
Community Support
Community Support

@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.

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.