This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
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
Hi @hettoritosi ,
Please give me some sample data. Then maybe I could give you one workaround.
Best Regards
Icey
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.
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. ![]()
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingI 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.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCheck out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 55 | |
| 31 | |
| 24 | |
| 23 |