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
Meneizs
Frequent Visitor

Duplicate rows cummulative

I have a dataset that's contains duplicates rows, that i need to maintain for some analysis.
My table is something like this:

CONTLOTEDATECONT/LOTE
100091012607/07/202210009-10126
100091012626/05/202210009-10126
100091012619/04/202210009-10126
100091012610/05/202210009-10126
100141013815/07/202210014-10138
100141013820/04/202210014-10138
100141013802/06/202210014-10138

And i need to add a suffix on duplicateds rows, ordered by Date. Something like this:

CONTLOTEDATECONT/LOTEDUPLICATED
100091012607/07/202210009-101264
100091012626/05/202210009-101263
100091012619/04/202210009-101261
100091012610/05/202210009-101262
100141013815/07/202210014-101383
100141013820/04/202210014-101381
100141013802/06/202210014-101382

 

I've already tried this column, but unsuccessful...

Column = CALCULATE (DISTINCTCOUNT ( Table1[Cont/Lote] ),
FILTER (Table1,
Table1[Date] = EARLIER ( Table1[Date] )
&& Table1[Cont/Lote] < EARLIER ( Table1[Cont/Lote] )))
+ 1

 

 

 

 

 

 

1 ACCEPTED SOLUTION
sevenhills
Super User
Super User

Based on your output, it seems you are looking for is Row Number by Group.

 

Row Number by Group - Static Column = 
 RANKX( 
        Filter('Table', 
               [CONT/LOTE] = Earlier('Table'[CONT/LOTE])
        )
        , 'Table'[DATE], , ASC, dense)

 

It took me a while to understand, as I was trying to correct the DAX. 

sevenhills_0-1654820520793.png

 

 


Tip: To post sample data, do copy and paste from Excel. 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=CALCULATE(COUNTROWS(Data),FILTER(Data,Data[CONT]=EARLIER(Data[CONT])&&Data[DATE]<=EARLIER(Data[DATE])))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
sevenhills
Super User
Super User

Based on your output, it seems you are looking for is Row Number by Group.

 

Row Number by Group - Static Column = 
 RANKX( 
        Filter('Table', 
               [CONT/LOTE] = Earlier('Table'[CONT/LOTE])
        )
        , 'Table'[DATE], , ASC, dense)

 

It took me a while to understand, as I was trying to correct the DAX. 

sevenhills_0-1654820520793.png

 

 


Tip: To post sample data, do copy and paste from Excel. 

Helpful resources

Announcements
Fabric Data Days is here Carousel

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.