Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Is there a way to add a cloumn to a table in Power Query that contains the aggregate of a partition of another column?
For example I have:
| Group | Value | Color |
| A | 1 | Red |
| A | 2 | Orange |
| A | 3 | Yellow |
| A | 4 | Green |
| A | 5 | Blue |
| B | 6 | Purple |
| B | 7 | Red |
| B | 8 | Orange |
| B | 9 | Yellow |
| B | 10 | Green |
I need the max Value per Group (without losing the granularity of Color):
| Group | Value | Color | MaxGroupValue |
| A | 1 | Red | 5 |
| A | 2 | Orange | 5 |
| A | 3 | Yellow | 5 |
| A | 4 | Green | 5 |
| A | 5 | Blue | 5 |
| B | 6 | Purple | 10 |
| B | 7 | Red | 10 |
| B | 8 | Orange | 10 |
| B | 9 | Yellow | 10 |
| B | 10 | Green | 10 |
In DAX, I can add a column and use:
MaxGroupValue =
CALCULATE (
MAX ( Table[Value] ),
ALLEXCEPT ( Table, Table[Group] )
)If there a way to do it in Power Query in one add-a-column step? I do not want to do a Group By (lose the Color granularity) and then have to merge back to the original table due to performance concerns.
Thank you!
Solved! Go to Solution.
Perfect, thank you!! This helps so much!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 66 | |
| 64 | |
| 31 | |
| 26 | |
| 26 |