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

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

Reply
Anonymous
Not applicable

Group by function

Hi gurus,

I have to use group by for filtering Max values in my data set but there is a weird thing happening. I was wondering what

Group by

function is doing? Here is my dataset and the job I need to do:

2019-07-27_19-28-00.jpg

Group by Ticket 
New column name:                                Operation:                                   Column:
Max                                              Maximum                                      Max

and the second situation when I have Qty as one of my column:

2019-07-27_19-28-55.jpg

First I merged Ticket&Qty with comma seperator and then I used Group by: Ticket&Qty and Maximum by Max cloumn.

The final result is so different:

in the first situation I have 166 rows after grouping them and in second situation I have 205 rows!

My question is why there is such a big descripancy and what exactly is Group by function does?

Thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous it is gong to return maximum value of unique value of group by columns

 

in 1st case, take unique ticket number and give the maximum qty

in 2nd case, take unique of ticket number & qty (concatenated file) and give the max qty and I expect more rows in 2nd case depending on data.

 

here is example

Ticket Qty

1       10

1       20

2       40

2       50

2       50

 

In first case, i will get two rows

Ticket    Max Qty

1             20 

2             50

 

in 2nd case I will get 4 rows

Ticket,Qty         Max Qty

1,10                    10

1,20                    20

2,40                    40

2,50                    50



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

1 REPLY 1
parry2k
Super User
Super User

@Anonymous it is gong to return maximum value of unique value of group by columns

 

in 1st case, take unique ticket number and give the maximum qty

in 2nd case, take unique of ticket number & qty (concatenated file) and give the max qty and I expect more rows in 2nd case depending on data.

 

here is example

Ticket Qty

1       10

1       20

2       40

2       50

2       50

 

In first case, i will get two rows

Ticket    Max Qty

1             20 

2             50

 

in 2nd case I will get 4 rows

Ticket,Qty         Max Qty

1,10                    10

1,20                    20

2,40                    40

2,50                    50



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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 Solution Authors