Forum Discussion

Goodkat's avatar
Goodkat
Icon for Helper II rankHelper II
2 years ago
Solved

Text.Combine within Table.Group fails on numeric keys, even with Number.ToText

Dear Power Query enthusiasts, I am regularly thrilled by the efficiencies and smart dataflows PowerQuery enables. To further aggregate which data is worth to display, and which could be hidden, I ha...
  • sevenhills's avatar
    2 years ago

    There are few ways you can solve ...

     

    Assuming Sub Step ID - copy is the duplicated column and marked as text.

     

    Method 1: Copy the number column and change the type as text and then use Text.Combine; Check "a" column

     

    Method 2: Using Text.Combine, List.Transform. Check "b" column

     

    Method 3: we may need distinct some times, using method 2, I can make distinct. Check "c" column.

     

     

     

    = Table.Group(#"Changed Type", {"Step ID"}, {{"sum1", each List.Sum([2021 Actual]), type nullable number}, {"sum2", each List.Sum([2021 Plan]), type nullable number}
         , {"a", each Text.Combine([#"Sub Step ID - Copy"], ","), type text}
         , {"b", each Text.Combine(List.Transform([Sub Step ID], Text.From), ", "), type text}
         , {"c", each Text.Combine(List.Transform(List.Distinct([Sub Step ID]), Text.From), ", "), type text}})

     

     

     

     

     

    Hope it helps, Thanks