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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
hettoritosi
Frequent Visitor

Group BY One Column

Hi Guys, I need to do something like this using Power Bi:

 

select MAX(QTD) , CLIENT_NAME, DEPARTMENT
from MY_TABLE
GROUP BY CLIENT_NAME

I tried to use GROUP BY function but did not return the expected result 

6 REPLIES 6
Icey
Community Support
Community Support

Hi @hettoritosi ,

Please give me some sample data. Then maybe I could give you one workaround.

 

Best Regards
Icey

YJ
Resolver II
Resolver II

Try this:

 

Table=Summarize('MY_TABLE',

'MY_TABLE'[CLIENT],

'MY_TABLE'[DEPARTMENT],

"MAX(QTY)",MAX('MY_TABLE'[QTY])

)

Correct for some syntax, but you should get the idea.

regards

Wouldn't you need to put GROUP BY Client Name, Department.

 

I don't think SQL likes when you have non aggregated columns not in a group by.

edhans
Community Champion
Community Champion

Power Query is more efficient at grouping, especially if the source is a relational database as it will fold the statement and make the server do the work. Just click on the Group By icon in the ribbon, select Advanced, and follow the prompts.

 

Consider posting your question not assuming readers can read SQL statements raw. I, for one, cannot. Smiley Happy



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

I tried to use Group By in Power Query Editor but the result tripled when i expand and selected some columns .

Could you share some data? GroupBy in Power Query doesn't just add extra rows. I use it all of the time. If you don't have a relationship right or aren't fully understanding how the underlying data exists then you will get unexpected results, but not incorrect results. That is true of Power Query, DAX, and even simple Excel formulas.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors