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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.