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
Syndicate_Admin
Administrator
Administrator

RECUENTO ACUMULATIVO DE VECES QUE APARECE UNA INFORMACIÓN UNIC

Hola a todos,

Tuve una situación en la que usaría esta fomula en EXCEL

=COUNTIF($C$4:C4,C4)

Para tener este RESULTADO en la COLUMNA "ACUMULATIVO"

Sh00un_0-1636545833815.png


Así que UKXX1 aparece 2 veces y dice 1 por primera vez y 2 por segunda vez aparece así sucesivamente.

¿Es posible hacer lo mismo en DAX? Lo he estado intentando de muchas maneras diferentes, pero no puedo hacerlo.

Gracias

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hay @Sh00un

Descargar archivo PBIX de ejemplo

Sé que ha preguntado sobre DAX, pero es muy fácil en Power Query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQr1jogwVIrViVYyQuEZQ3lGYJ4JlGcM5pmi8MxQeOYoPAsozxTMs4TyzJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Index = _t, #"ROUTE NUMBER" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ROUTE NUMBER", type text}, {"Index", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Count(List.FindText(List.FirstN(#"Changed Type"[ROUTE NUMBER],[Index]),[ROUTE NUMBER]))),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"

ranks.png

Saludos

Phil

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Hay @Sh00un

Descargar archivo PBIX de ejemplo

Sé que ha preguntado sobre DAX, pero es muy fácil en Power Query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQr1jogwVIrViVYyQuEZQ3lGYJ4JlGcM5pmi8MxQeOYoPAsozxTMs4TyzJViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Index = _t, #"ROUTE NUMBER" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ROUTE NUMBER", type text}, {"Index", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Count(List.FindText(List.FirstN(#"Changed Type"[ROUTE NUMBER],[Index]),[ROUTE NUMBER]))),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Index"})
in
    #"Removed Columns"

ranks.png

Saludos

Phil

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.