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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pandrade
Regular Visitor

¿Cómo enumerar valores duplicados?

Hola,

 

Necesito ayuda con una duda que no consigo resolver

 

Tengo una tabla con los siguientes valores:

 

bi.png

 

Necesito poder enumerar el número de veces que se repite el cliente por orden, es decir, una nueva columna que ponga:

1

2

3

 

Por el momento he conseguido contar el número de veces que se repite cada cliente pero no avanzo más.

 

¡Gracias de antemano!

4 REPLIES 4
v-cgao-msft
Community Support
Community Support

Hi @Pandrade ,

 

If there is no column like order column in the table, you need an index column. You can add it in Power Query Editor.

Transform data -> Add Column -> Index Column -> From 1 -> Close and apply.

vcgaomsft_0-1649228738817.png

Please new a calculated column.

Column = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER(ALL('Table'),'Table'[cliente] = EARLIER ( 'Table'[cliente] )),
    'Table'[Index] <= EARLIER( 'Table'[Index] )
)

Result.

vcgaomsft_1-1649229041327.png

Attach the PBIX file for reference. Hope it helps.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems with it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Cómo podría escribir esta misma función pero en lenguaje M para poder utilizarla en Power query. Gracias de antemano.

YOUUUU AREEEE THE BESTTT!!!! Naahhh bro thank you so much, I've been stoped in this problem ❤️ thank you

amitchandak
Super User
Super User

@Pandrade , One is to create a new column

 

countx(filter(Table, Table[Client] = earlier(Table[Client]) ) ,[Client])

 

if you need it based on measures you need Dynamic Segmentation

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors