Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Grouping/summing rows

Hi, I hope someone can help: I have a simple table like this:

 

I need to make another table which groups/sums these rows together into new names (new1=A+B, new2=C, new3=D+E+F), like this:

I tried the 'Group' function but I couldn't make it work.

How can this be done?

Thank you very much

  • Hi Anonymous 

    You may add a column with IF Function.Then drag them to table visual to get the table.

    Column = 
    IF (
        Table1[categories] IN { "A", "B" },
        "new1",
        IF ( Table1[categories] IN { "D", "E", "F" }, "new3", "new2" )
    )

    Or create the table with SUMMARIZE Function.

    Table = SUMMARIZE(Table1,Table1[Column],"Open",SUM(Table1[Open]),"Engaged",SUM(Table1[Engaged]),"Highly",SUM(Table1[Highly]))

    Regards,

2 Replies

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    when you load the data (get data), go to Add Column\condtional column.  You should be able to build what you want there as an extra column

  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Anonymous 

    You may add a column with IF Function.Then drag them to table visual to get the table.

    Column = 
    IF (
        Table1[categories] IN { "A", "B" },
        "new1",
        IF ( Table1[categories] IN { "D", "E", "F" }, "new3", "new2" )
    )

    Or create the table with SUMMARIZE Function.

    Table = SUMMARIZE(Table1,Table1[Column],"Open",SUM(Table1[Open]),"Engaged",SUM(Table1[Engaged]),"Highly",SUM(Table1[Highly]))

    Regards,