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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Clustering / Visualizing Ordered Process Steps

Hi all,

 

I am looking for some inspiration or an exact solution to achieve clusters of process steps. My data looks like the following:

 

 

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

 

 

The significance of order is for each key, the process step will be complete according to the Order field sorted in ascending order. For example, the actual sequence for Key 1 is A - C - B - A.

 

I am looking to achieve the following through my data: a matrix / potential (cluster) where the values in the matrix represent a count over all keys where a process step procedes another process step. For example, Key 1's process is A-C-B-A giving the matrix of the following:

 

 ABC
A  1
B1  
C 1 

 

The end result for the sample data provided will be as such:

 

 ABCDE
A  211
B1 1  
C 2  2
D     
E  1  

 

 

My question is twofold:

  1. How can I achieve this using DAX and potentially PowerQuery? 
  2. Is this the best approach (are there custom visualizations available?) to visualize the commonality between process steps?

 

Thank you, any bit of guidance or advice helps!

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

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
daxer-almighty
Solution Sage
Solution Sage

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.