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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Charuta
Frequent Visitor

Column and Row Grouping

UniqIDkeyIDSourceLinkTypeDestination
1101blocksC
2101is blocked byB
3101dependsD
4102Bis blocked byD
5102BblocksA
6103Cis blocked byA
7104DblocksB
8104Dis depended byE

 

I have data in the above format in my database 

What I need to show is something like below so that I can use it further as columns in decomposition tree - Is this feasible?

SourceLinkType 1DestinationLinkType 2KeyLinkType 3Key 
blocksC    
is blocked byBis blocked byD  
dependsD    
Cis blocked byAis blocked byis blocked by D
blocksBblocksA  
is depended byE    
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Charuta ,

According to your description, here's my solution.

Create four measures.

Key2 =
MAXX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Source] = MAX ( 'Table'[Destination] )
            && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
    ),
    'Table'[Destination]
)
Link Type2 = IF([Key2]=BLANK(),BLANK(),MAX('Table'[LinkType]))
Key3 =
MINX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Source]
            = MAXX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Source] = MAX ( 'Table'[Destination] )
                        && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
                ),
                'Table'[Destination]
            )
            && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
    ),
    'Table'[Destination]
)
Link Type3 = IF([Key3]=BLANK(),BLANK(),MAX('Table'[LinkType]))

 Get the correct result.

vkalyjmsft_0-1653544843849.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @Charuta ,

According to your description, here's my solution.

Create four measures.

Key2 =
MAXX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Source] = MAX ( 'Table'[Destination] )
            && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
    ),
    'Table'[Destination]
)
Link Type2 = IF([Key2]=BLANK(),BLANK(),MAX('Table'[LinkType]))
Key3 =
MINX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Source]
            = MAXX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Source] = MAX ( 'Table'[Destination] )
                        && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
                ),
                'Table'[Destination]
            )
            && 'Table'[LinkType] = MAX ( 'Table'[LinkType] )
    ),
    'Table'[Destination]
)
Link Type3 = IF([Key3]=BLANK(),BLANK(),MAX('Table'[LinkType]))

 Get the correct result.

vkalyjmsft_0-1653544843849.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.