Forum Discussion

KatkaS's avatar
KatkaS
Post Patron
3 years ago
Solved

Grouping by?

Hello could anyone please help me with following? I have below table and I would need to make pairs of Codes by column Name - is there a way how to do it in Power BI??   example - I would need a ...
  • Greg_Deckler's avatar
    3 years ago

    KatkaS Try:

    Table 2 = 
        VAR __Table = 
            GENERATE(
                'TableCodes',
                DISTINCT(SELECTCOLUMNS(FILTER(ALL(TableCodes),[Name] = EARLIER(TableCodes[Name])),"__Code",[Code]))
            )
    RETURN
        SELECTCOLUMNS(
            ADDCOLUMNS(
                FILTER(__Table,[Code] <> [__Code]),
                "__New",[Code] & " + " & [__Code]
            ),
            "Name",[Name],
            "Code",[__New]
        )