- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Grouped By Query
I have a table of Academics working on projects within specific departments which I need to summarise by Subproject Data ID. Each project has a single 'Lead Subproject' and each Academic has a Credit %. Project and Subproject are concatenated to provide Subproject Data ID. The table is sorted Z-A on Lead_Subproject and Largest to Smallest on Credit.
I have used 'Group by' to consolidate the data by Subproject_Data_ID, Project and Subproject, but I need to populate Lead_Subproject and Project_Lead with the first matching entries in the first table (which is why it is sorted):
At the moment I have to do this in Excel after loading the query using Xlookup/Index(Match()), but is there a way to do it within the Group By code?
Best,
Bernie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Bernie6808 ,
just apply a dummy-operation (like SUM or MAX) on those 2 columns and afterwards tweak the generated M-code a bit:
List.Sum or List.Max should become List.First instead.
Regarding the sorting, you might want to consider a Table.Buffer:
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Bernie6808 - not sure if you manage to achieve the desired output, but like to spin with an different way of approach. Try this and let me know if this fixes your issues. Give me a shout out if you need any more details PBIX File attached. Grouped by Query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Bernie6808 ,
just apply a dummy-operation (like SUM or MAX) on those 2 columns and afterwards tweak the generated M-code a bit:
List.Sum or List.Max should become List.First instead.
Regarding the sorting, you might want to consider a Table.Buffer:
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Perfect! Thanks!

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
10-14-2024 07:56 AM | |||
07-29-2024 06:09 AM | |||
04-17-2024 05:44 PM | |||
05-03-2024 04:17 PM | |||
08-11-2024 05:53 AM |