Power bi sum group by multiple columns

Here we will see two examples on Power bi sum group by multiple columns and Power bi sum group by two columns.

How power bi sum group by multiple columns

Here we will see Power bi sum and group by multiple columns in power bi.

Here is the sample data we are going to use to solve this problem.

How power bi sum group by multiple columns
How power bi sum group by multiple columns

Here we will combine column1 by commas and sum the column2 based on column 3. So, it will show A,B,C(column1) 114(column2) XX(column3)

For this, we will create a calculated table by using Power Bi Dax.

  • To create a new table, Click on the Modelling -> New table.
  • Then write the DAX formula:
Combined = 
SUMMARIZE (
    'Table',
    'Table'[Column3],
    "Column1", CONCATENATEX ( 'Table', 'Table'[Column1], "," ),
    "Column2", SUM ( 'Table'[Column2] )
)
How power bi sum group by multiple columns
How power bi sum group by multiple columns

In the below screenshot, you can see the power bi sum group by multiple columns.

How power bi sum group by multiple columns
How power bi sum group by multiple columns

Read Countif function in Power BI Measure

Power bi sum group by two columns

Here we will see the Power bi sum group by two columns using power query in power bi desktop.

We will use the below sample data to find the sum group by two columns in power bi desktop.

How power bi sum group by two columns
How power bi sum group by two columns

We will sum up the values based on WO# and group them by serial using power query.

  • In Power bi desktop click on the Transform Data from the ribbon, to open power query editor.
  • In power query editor, Click on Transform tab -> Group by.
power bi sum group by two columns
power bi sum group by two columns
  • Now Group By window will open, then select the Advanced option.
  • From the dropdown select Serial. Next click on Add Grouping.
  • Then from the dropdown select WO#.
  • Change the name of the column to SumOfValue, by default it is count.
  • Then change the aggregation to Sum from the dropdown list.
  • Select the aggregation column, here it is value column.
  • Click on OK.
power bi sum group by two columns
power bi sum group by two columns

In the below screenshot you can see the power bi sum group by two columns using power query

power bi sum group by two columns
power bi sum group by two columns

You may also like the following Power BI tutorials:

In this power bi tutorial, we learned power bi sum group by multiple columns. And also we discussed the below points power bi sum group by two columns using power query.

>