cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Progressive Frequent Visitor
Frequent Visitor

Combine and SUM multiple columns

Hi,

 

I created dashbord table and I would like to combine the column1 with commas and SUM the column2 based on column3. Is it possible?

 

I have a table like this,

Column1,Column2,Column3

A5XX
B10XX
C12XX
D3YY
F8YY
G15ZZ
Y4SS
H1BB

 

Final result should be like below

Column1,Column2,Column3

A,B,C27 (5+10+12)XX
D,F11(3+8)YY
G15ZZ
Y4SS
H1BB

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Combine and SUM multiple columns

Create a meausre like this:

 

Measure = CONCATENATEX(VALUES('Table'[Column1]),[Column1],",") 

Create a table visualization with Column 3, Column 2 with default SUM and this measure.

 

 


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Combine and SUM multiple columns

Create a meausre like this:

 

Measure = CONCATENATEX(VALUES('Table'[Column1]),[Column1],",") 

Create a table visualization with Column 3, Column 2 with default SUM and this measure.

 

 


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Highlighted
v-yulgu-msft Super Contributor
Super Contributor

Re: Combine and SUM multiple columns

Hi @Progressive,

 

Alternatively, you could new a calculated table with this formula:

New Table =
SUMMARIZE (
    Table,
    Table[Column3],
    "Column1", CONCATENATEX ( Table, Table[Column1], "," ),
    "Column2", SUM ( Table[Column2] )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Progressive Frequent Visitor
Frequent Visitor

Re: Combine and SUM multiple columns

Hi @v-yulgu-msft,

I tried your formula and it works with one downside. Now, I have duplicates in Column1. Like A,B,C,A,A,A,A

Is there anyway to remove dubs in Column1. Something like DISTINCT SUMMARIZE 🙂

 

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 32 members 1,899 guests
Please welcome our newest community members: