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

Agrupación en clústeres / Visualización de pasos de proceso ordenados

Hola a todos

Estoy buscando alguna inspiración o una solución exacta para lograr clústeres de pasos de proceso. Mis datos son similares a los siguientes:

llaveProcess_Nameorden
1A10
1A40
1B30
1C20
1D50
2A10
2B40
2C30
2E20
3B10
3C20
3E30
4A10
4C20
4E30

La importancia del orden es para cada clave, el paso del proceso se completará de acuerdo con el campo Orden ordenado en orden ascendente. Por ejemplo, la secuencia real para la clave 1 es A - C - B - A.

Estoy buscando lograr lo siguiente a través de mis datos: una matriz / potencial (clúster) donde los valores en la matriz representan un recuento sobre todas las claves donde un paso de proceso procede a otro paso de proceso. Por ejemplo, el proceso de la clave 1 es A-C-B-A dando la matriz de lo siguiente:

ABC
A 1
B1
C 1

El resultado final de los datos de la muestra proporcionados será como tal:

ABCDE
A 211
B1 1
C 2 2
D
E 1

Mi pregunta es doble:

  1. ¿Cómo puedo lograr esto usando DAX y potencialmente PowerQuery?
  2. ¿Es este el mejor enfoque (¿hay visualizaciones personalizadas disponibles?) para visualizar la similitud entre los pasos del proceso?

Gracias, cualquier poco de orientación o consejo ayuda!

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

daxeralmighty_0-1624492553442.png

daxeralmighty_1-1624492586114.png

daxeralmighty_2-1624492627427.png

daxeralmighty_3-1624492673945.png

Key Count = 
// Count the Keys where the current preceeding process
// is the direct ancestor of the current succeeding
// process (based on the Order column) in the current
// context. This means the measure is sensitive to
// any filters put on the T table.
var OnlyOneCombinationVisible = COUNTROWS( 'Process Pairs' ) = 1
var Result =
    if( OnlyOneCombinationVisible,
        var CurrentPrecedingProcess = 
            SELECTEDVALUE( 'Process Pairs'[Preceding Process] )
        var CurrentSucceedingProcess =
            SELECTEDVALUE( 'Process Pairs'[Succeeding Process] )
        return
            SUMX(
                CALCULATETABLE(
                    SUMMARIZE(
                        T,
                        T[Key],
                        T[Order]
                    ),
                    KEEPFILTERS( 
                        T[Process] = CurrentPrecedingProcess
                    )
                ),
                var CurrentKey = T[Key]
                var CurrentOrder = T[Order]
                var NextProcess =
                    MAXX(
                        TOPN(1,
                            FILTER(
                                T,
                                and(
                                    T[Key] = CurrentKey,
                                    T[Order] > CurrentOrder
                                )
                            ),
                            T[Order],
                            ASC
                        ),
                        T[Process]
                    )
                return
                    if( NextProcess = CurrentSucceedingProcess, 1 )
        )
    )
return
    Result

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

daxeralmighty_0-1624492553442.png

daxeralmighty_1-1624492586114.png

daxeralmighty_2-1624492627427.png

daxeralmighty_3-1624492673945.png

Key Count = 
// Count the Keys where the current preceeding process
// is the direct ancestor of the current succeeding
// process (based on the Order column) in the current
// context. This means the measure is sensitive to
// any filters put on the T table.
var OnlyOneCombinationVisible = COUNTROWS( 'Process Pairs' ) = 1
var Result =
    if( OnlyOneCombinationVisible,
        var CurrentPrecedingProcess = 
            SELECTEDVALUE( 'Process Pairs'[Preceding Process] )
        var CurrentSucceedingProcess =
            SELECTEDVALUE( 'Process Pairs'[Succeeding Process] )
        return
            SUMX(
                CALCULATETABLE(
                    SUMMARIZE(
                        T,
                        T[Key],
                        T[Order]
                    ),
                    KEEPFILTERS( 
                        T[Process] = CurrentPrecedingProcess
                    )
                ),
                var CurrentKey = T[Key]
                var CurrentOrder = T[Order]
                var NextProcess =
                    MAXX(
                        TOPN(1,
                            FILTER(
                                T,
                                and(
                                    T[Key] = CurrentKey,
                                    T[Order] > CurrentOrder
                                )
                            ),
                            T[Order],
                            ASC
                        ),
                        T[Process]
                    )
                return
                    if( NextProcess = CurrentSucceedingProcess, 1 )
        )
    )
return
    Result

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.