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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
yogeshk77
Helper I
Helper I

Multiple rows into a single column with Many to Many relationship

I have following tables with two level parent child hirarchy

yogeshk77_0-1664797115475.png

 

yogeshk77_1-1664797134498.png

 

yogeshk77_2-1664797157799.png

 

And the output I need is a , comma separated Repo Names column in Story Table as seen below ->

 

yogeshk77_3-1664797206680.png

Can someone please help me with a DAX query for the same?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Repos =
VAR CurrentStory = Story[Story ID]
VAR PRs =
    CALCULATETABLE (
        VALUES ( 'Story PR'[PR ID] ),
        TREATAS ( { CurrentStory }, 'Story PR'[Story ID] )
    )
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( 'PR Repo'[Repo name] ),
            TREATAS ( PRs, 'PR Repo'[PR ID] )
        ),
        'PR Repo'[Repo name],
        ", "
    )

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

Repos =
VAR CurrentStory = Story[Story ID]
VAR PRs =
    CALCULATETABLE (
        VALUES ( 'Story PR'[PR ID] ),
        TREATAS ( { CurrentStory }, 'Story PR'[Story ID] )
    )
RETURN
    CONCATENATEX (
        CALCULATETABLE (
            VALUES ( 'PR Repo'[Repo name] ),
            TREATAS ( PRs, 'PR Repo'[PR ID] )
        ),
        'PR Repo'[Repo name],
        ", "
    )

@johnt75 , you are awesome ! Thanks much

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors