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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
DDON
Frequent Visitor

Data maniplulation after grouping

Happy Friday!

 

I am trying to extract data specific for each group from one column in a table based on finding the maximum value in another column.

 

I have the following setup

Key = column by which data is to be grouped

Reference = The column I wish to use to identify/manipulate data

Value = The values I want to output

 

DDON_1-1619207372330.png

 

 

Scenario 1

I wish to find the corresponding value for the maximum reference within a group:

DDON_0-1619207305836.png

Scenario 2

(I may be pushing my luck here!)

I wish use the numbers in the Reference column to perform an operation upon the value column - here it is Average(Reference x Value). I am less fussed about the exact formulation here but the method I can apply

 

DDON_2-1619208009017.png

 

I would be hugely greatful for any ideas/solutions


Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

image.png

 

try using this M-expression

 

image.png

 

 

 

then expand column records:

 

image.png

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

 

image.png

 

you should group by on key using UI (for example) in this way:

 

image.png

Thanks for your reply, as far as I can tell the Group GUI only allows operations on one column. In scenario 1 I am not really interested in the max of R but which V is on the same row as th max of R.

 

Sorry if I am missing something in your reply

Anonymous
Not applicable

image.png

 

try using this M-expression

 

image.png

 

 

 

then expand column records:

 

image.png

Perfect. Thanks for your time on that. I think I understand the syntax of the solution apart from the "_". If you have a moment could you explain what that is up to or point me towards the documentation.

 

Thanks again

Anonymous
Not applicable

You can just add a MAX operation on the Value column right from the Group function GUI. Also add an All Rows column. That should give you what you are looking for. You'll have what you need to then add the average column.

--Nate

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors