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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Winter_king94
Helper I
Helper I

Group By in Power Query

Hello,

 

I am working a data set that is too large to load into Power BI. To limit the data I am trying to group by.

My problem is that when I group by, not all the unique email names are being brought through. I have validated that all my necessary rows are shown in the step prior to group by, just not in the preview for the group by step. 

 

Below is my group by 

Winter_king94_0-1732120075931.png

any help would be greatly appreciated. 

1 ACCEPTED SOLUTION
Winter_king94
Helper I
Helper I

Thanks everyone for you help. I found the solution by reordering my steps and doing the group by earlier in my process rather than as the last step.

View solution in original post

9 REPLIES 9
Winter_king94
Helper I
Helper I

Thanks everyone for you help. I found the solution by reordering my steps and doing the group by earlier in my process rather than as the last step.
Omid_Motamedise
Super User
Super User

Can you provide your sample data?


If my answer helped solve your issue, please consider marking it as the accepted solution.
PwerQueryKees
Super User
Super User

Please share your complete query (the M code from advanced editor).

A sample of your data will be helpfull.


Also try to filter on the three emails you were expecting before grouping and see if they appear then. Share what happens?

 

My wild guess?

 

Powerquery is free to sort your data anyway it sees fit to process your query the fastest, so your 3 emails may not end up together. You are grouping on 2 columns, so PQ might have decided sort on Email_Sent_Date_CDT first. Could this be the reason you can't find them?
You can test this by filtering on your 3 email addressses after the group by.

Anonymous
Not applicable

Seeing as your data set is so large, you just might not be getting all of the values in the preview, but if you load your data set, they will be there.

 

--Nate

Unfortunately, whatever I see in my preview is the only data that loads into desktop. Anything not in the group by preview doesn't flow through. 

Anonymous
Not applicable

I would try grouping on the two columns, and use the "All Rows" aggregation. If that gives you all of your unique values, then use the expand columns aggregations.

 

--Nate

Winter_king94
Helper I
Helper I

Thanks, @Greg_Deckler ..... I understand that.. Let me try to clarify my problem better with an example..
I have three distinct email names with 3 distinct ids, and after grouping only one of those emails appears in the preview. The other two emails can't be found. I have tried grouping by the ids, the email names, but am still only ending up with one of the three email names after grouping. 

@Winter_king94 I would try loading the query and then make a determination about whether all of the IDs are there or not. I would not trust the Preview pane for that as doing the grouping could switch which of the 1000 rows it grabs from the source system.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Winter_king94 Well, that's sort of the purpose of grouping. If all the unique rows were brought through then it would be the same as not grouping them at all.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.