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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
davidson929
Regular Visitor

Sum Like Values from Differing Columns

Hello,

 

I am trying to sum like values from different columns across multiple records. I can't seem to figure out to how to get them to sum all together.

 

Here is an example data set:

Record ID          Category #1    Category #2     Category #3    Category #4    Record Count

1AB  1
2B   1
3BDF 1
4BB  1
5C   1
6CE  1
7CEE 1
8CBCC1
9CCCB1
10CF  1

 

What I am trying to do in PowerBI is return a value that displays the sum total like so:

A = 1

B = 7

C = 10

 

I would like this displayed in a graph if possible as well. Any help would be appreciated.

1 ACCEPTED SOLUTION
drewlewis15
Solution Specialist
Solution Specialist

One option would be to unpivot your Category columns using the Power Query Editor 

  1. Click Edit Queries
  2. Select all Category columns
  3. Go to the Transform tab and click "Unpivot Columns"

 

This will take your table that currently looks like this:

Source.png

 

And turn it into this:

Unpivot.png

 

You can now create a visual and simply drop the "Value" column (or whatever you end up naming it) into both the Axis (or legend) and Value fields (Count of Value).  Finally, just filter the visual to not include records where the value is blank.

Final.png

 

View solution in original post

1 REPLY 1
drewlewis15
Solution Specialist
Solution Specialist

One option would be to unpivot your Category columns using the Power Query Editor 

  1. Click Edit Queries
  2. Select all Category columns
  3. Go to the Transform tab and click "Unpivot Columns"

 

This will take your table that currently looks like this:

Source.png

 

And turn it into this:

Unpivot.png

 

You can now create a visual and simply drop the "Value" column (or whatever you end up naming it) into both the Axis (or legend) and Value fields (Count of Value).  Finally, just filter the visual to not include records where the value is blank.

Final.png

 

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.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors