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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
bmarcowka
Helper I
Helper I

Repeating Record Values

I have a dataset of approximately 2.9m records that I am trying to find the records that have matching field values over the course of the preceding X (dynamic) number of days/weeks.  What would be the best way to just filter these specific records only? 

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @bmarcowka ,

 

My recommendation would be to select the field you want to check for duplicates, then run the GUI 'Keep Duplicates' function (Home tab > Keep Rows dropdown > Keep Duplicates).

Once PQ has generated the function for you, edit the table name within the Table.Group function wit a Table.SelectRows function to select your dates.

 

So you would go from seeing something like this in the formula bar:

BA_Pete_0-1632474986456.png

 

To something like this:

BA_Pete_1-1632475043797.png

 

In terms of your 'dynamic' requirement, PQ isn't really 'dynamic' in this way. I think the closest you would get to dynamic in PQ would be to have a separate query which only contains a date which can be referenced within a >, <, >=, <=, calculation within the Table.SelectRows function you added above.

 

Hope this makes sense.

 

Pete



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

Proud to be a Datanaut!




Anonymous
Not applicable

This feels too easy, but wouldn't the remove dulplicates option under the Remove Rows drop down work? Or insert the below code in the advanced editor. The below example is for when you want to remove rows when values in columns 1 and 2 are duplicated.

= Table.Distinct(#"Previous Step", {"Column1", "Column2"})

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.