Forum Discussion
yogeshk77
3 years agoHelper I
Multiple rows into a single column with Many to Many relationship
I have following tables with two level parent child hirarchy And the output I need is a , comma separated Repo Names column in Story Table as seen below -> Can s...
- 3 years ago
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
3 years agoSuper 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],
", "
)