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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.