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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Anonymous
Not applicable

Help! PowerQuery Problem (Permutation)

Hi everyone, i hope you are doing well...

My problem: I need to know the number of iterations between teams that worked on the same epic.

My data is something like:

Epic NameTeam
AX
AY
AZ
BX
BY
CZ
CY


For example:
Epic A i have three teams working together, so the possibilities are: XY, XZ, YX,YZ, ZX, ZY.

Epic B: XY, YX.

Epic C: ZY, YZ


The result would/could be something like (considering the 3 epics above) - this is the output that i want but idk how to do that

Teamxyz
x ----21
y2----2
z12----

 

If anyone solve this problem, could you please send me the editor script ?! that would be great 😃

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Try it.

let
    Source = Table.NestedJoin(Data, {"Epic Name"}, Data1, {"Epic Name"}, "Data1", JoinKind.LeftOuter),
    #"Expanded Data1" = Table.ExpandTableColumn(Source, "Data1", {"Team"}, {"Data1.Team"}),
    #"Added Conditional Column" = Table.AddColumn(#"Expanded Data1", "Custom", each if [Team] = [Data1.Team] then 1 else null),
    #"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([Custom] = null)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"

The final show:

vyalanwumsft_0-1663914937294.png

Solved: Generating row value combinations - Microsoft Power BI Community

Permutations table in Power BI or Power Query in Excel – The BIccountant

Solved: Permutations and Combinations - Microsoft Power BI Community
Best Regards,
Community Support Team _ Yalan Wu
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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Try it.

let
    Source = Table.NestedJoin(Data, {"Epic Name"}, Data1, {"Epic Name"}, "Data1", JoinKind.LeftOuter),
    #"Expanded Data1" = Table.ExpandTableColumn(Source, "Data1", {"Team"}, {"Data1.Team"}),
    #"Added Conditional Column" = Table.AddColumn(#"Expanded Data1", "Custom", each if [Team] = [Data1.Team] then 1 else null),
    #"Filtered Rows" = Table.SelectRows(#"Added Conditional Column", each ([Custom] = null)),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"

The final show:

vyalanwumsft_0-1663914937294.png

Solved: Generating row value combinations - Microsoft Power BI Community

Permutations table in Power BI or Power Query in Excel – The BIccountant

Solved: Permutations and Combinations - Microsoft Power BI Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

#"Coluna em pivô" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Data1.Team]), "Data1.Team", "Epic Name", List.Count),
#"Colunas Reordenadas" = Table.ReorderColumns(#"Coluna em pivô",{"Team", "X", "Y", "Z"})

Thanks, your script + script above i can achieve the result wanted! ❤️

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

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.