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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mvgust
Helper III
Helper III

Why would group by be filtering out records

I've got a table with 2.4 million records. I'm running into a situation where when using the group by function, it's incorrectly filtering out records. 

I've got timecard records, and I'm looking to obtain the min time value for a day, pretty basic group by function.

dataset.jpg 

 

Below is an example.  If I pre-filter the data to a particular record id, it will complete the group by on that record without issues. 
filtering to 1 recordfiltering to 1 recordgroup by completes with no issuesgroup by completes with no issues

So I know the record exists, and the group by function can obtain the min time value for a days.

However, when I move the filter to below the group by (to ensure that record is in my recordset) the record doesn't exist after the group by.
step 3 example.jpg

Any idea why this would be happening? This record should be included in my grouped by dataset.  Below is the complete M code in case I've missed something obvious as to why the record isn't there.

let
Source = #"TIS TIS_1448_TIMECARDSAVELOG",
#"Grouped Rows" = Table.Group(Source, {"Tcid", "Date"}, {{"Min", each List.Min([Time]), type time}}),
#"Filtered Rows" = Table.SelectRows(#"Grouped Rows", each [Tcid] = 8592184)
in
#"Filtered Rows"


Thank you.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @mvgust ,

 

I'm not able to reproduce this issue during my own tests.

I suspect that your preview cache may be getting confused by your process order i.e. Filter > Group > Move Filter.

Try going to the Home tab in Power Query and hitting 'Refresh Preview'.

BA_Pete_0-1681797311580.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @mvgust ,

 

I'm not able to reproduce this issue during my own tests.

I suspect that your preview cache may be getting confused by your process order i.e. Filter > Group > Move Filter.

Try going to the Home tab in Power Query and hitting 'Refresh Preview'.

BA_Pete_0-1681797311580.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hadn't thought I'd need to hit the refresh again if I shifted the order but that does make sense.  Thank you.

Anonymous
Not applicable

Not really a solution but I copied your data snapshot and m code and it works as expected, have you done a manual preview refresh when on the last step or output to a table and checked that entries to see if they appear?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.