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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.