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

Crear índice con valores únicos

Estoy tratando de formatear los datos que estoy extrayendo de nuestro sistema telefónico. Nuestro sistema telefónico escribe una regla de mesa para cada paso en el que pasa una llamada telefónica (entrando en la conexión principal, transfiriendo al menú del teléfono, transfiriendo al departamento, transfiriendo a un agente, etc.)

Los datos que quiero ver es el último paso de la llamada telefónica que siempre está respondiendo por un agente. Estoy tratando de lograr esto mediante la creación de un índice para que pueda obtener los datos del valor de índice más alto, pero estoy atascado.

Un ejemplo de mis datos:

Fecha/HoraIdentificador de llamadaNúmero de teléfono
2020-08-11 12:13:47151680+3161234567
2020-08-11 12:13:47151680+3161234567
2020-08-11 12:13:49151680+3161234567
2020-08-11 12:13:49151680+3161234567
2020-08-11 12:14:02151680+3161234567
2020-08-11 12:14:02151680+3161234567

Normalmente haría esto creando un índice de cliente con un rankx basado en el identificador de llamada y la fecha / hora como esta:

RANKX (
    FILTER ( 'Table', 'Table'[Call ID] = EARLIER ('Table'[Call ID] ) ),
    'Table'[Date/Time],
    ,
    ASC,
    Dense
)

Pero como usted puede entender esto da valores de índice dobles como 2 por 1, 2 por 2, 2 por 3, etc.

Estoy buscando un método para hacer un índice con valores únicos, por favor consejo.

¡Gracias de antemano!

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@lgeraeds - Echa un vistazo al mítico índice DAX - https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/td-p/1093214 maneja los lazos sin problemas.

Pero, debería hacerlo en Power Query, pero parece que su situación no puede.

Dicho esto, no entiendo por qué no puedes usar Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@lgeraeds - Echa un vistazo al mítico índice DAX - https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Mythical-DAX-Index/td-p/1093214 maneja los lazos sin problemas.

Pero, debería hacerlo en Power Query, pero parece que su situación no puede.

Dicho esto, no entiendo por qué no puedes usar Lookup Min/Max - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
DataZoe
Employee
Employee

@lgeraeds También puede hacerlo en la pantalla "Transformar datos". Agregue un paso para ordenar los datos por número, luego por fecha y, a continuación, agregue una columna de índice.

indexsort.JPG

Puede ver lo anterior pegando esto en el editor avanzado de una consulta en blanco:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WstA3NNA3MjAyUNJRMjQyVorVwSlmCBMzMTXDI2YJEzK3sIQKmaOYFgsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Number = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Number", Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Changed Type",{{"Number", Order.Ascending}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Sorted Rows",{{"Date", type datetime}}),
    #"Sorted Rows1" = Table.Sort(#"Changed Type1",{{"Date", Order.Ascending}}),
    #"Added Index" = Table.AddIndexColumn(#"Sorted Rows1", "Index", 1, 1, Int64.Type)
in
    #"Added Index"

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

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.