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 de actualizaciones de ID

Hola a todos

Necesito averiguar cuántas veces hubo cambios a partir del ID inicial

El resultado final debe estar en este ejemplo debajo del ID inicial 6716634 cambiado 4 veces.

adelmonte_0-1663941552587.png

Hoja de cálculo de Google

Muchas gracias por su ayuda.

Alex

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Gracias por proporcionar los datos de muestra. Eso ayuda mucho a proponer una posible solución.

Paso 1: Corrija sus datos de origen ya que faltan un par de ID antiguos en la lista ID actual.

6715687
6721494
6723089
6727961
6728120
6738710
6750036
6751305
6751414
6752705
6764652
6769456
6769674
6774626

Segundo paso: Crear una columna calculada de ruta

Column = path(Data[Current ID],Data[Old ID])

Paso 3 - El número de cambios equivale a PATHLENGTH menos uno.

Changes = pathlength([Column])-1

lbendlin_0-1664063259022.png

Ver adjunto

Hola @lbendlin,
Muchas gracias por su ayuda hasta ahora.
No puedo corregir los datos, ya que esta es la situación real de los datos y también debería poder manejar estas situaciones en el futuro. 😞
¿Hay alguna manera de manejar esto? Excluyendo de alguna manera a los que no coinciden.

Gracias

Alex

Puede incluir la reposición como parte de Power Query.

let
    Source = Excel.Workbook(File.Contents("C:\Users\xxx\Downloads\Count of ID Updates.xlsx"), null, true),
    Data_Sheet = Source{[Item="Data",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Data_Sheet, [PromoteAllScalars=true]),
    Combined = #"Promoted Headers" & Table.FromList(List.Distinct(List.Difference(#"Promoted Headers"[Old ID],#"Promoted Headers"[Current ID])), Splitter.SplitByNothing(), {"Current ID"}, null, ExtraValues.Error),
    #"Filtered Rows" = Table.SelectRows(Combined, each ([Current ID] <> null))
in
    #"Filtered Rows"

ver adjunto.

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.