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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to sum two column fields?

Hello,

 

I have two column that i would like to add. One column is the result of a calculation field called goal events adjusted and the other one is a column called all goals.

I have been trying to add up these two columns but the result is wrong. 

I am using sumx as function somone have any suggestions?

 

 

Thank you.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

If the two columns you are trying to add together are in the same table then:

 

To add a new sum column:

_summedValues = [column1name] + [column2name]

 

To add as a measure:

_summedValues = SUM(yourTable[column1name]) + SUM(yourTable[column2name])

 

If they are not in the same table then you must ensure the two tables are related, then you can do the following:

 

To add a new sum column:

_summedValues = yourTable1[column1name] + RELATED(yourTable2[column2name])

 

To add as a measure:

_summedValues = SUM(yourTable1[column1name]) + SUM(yourTable2[column2name])

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Anonymous ,

It would be nice if you share some sample data of your scenario to understand the context.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

If the two columns you are trying to add together are in the same table then:

 

To add a new sum column:

_summedValues = [column1name] + [column2name]

 

To add as a measure:

_summedValues = SUM(yourTable[column1name]) + SUM(yourTable[column2name])

 

If they are not in the same table then you must ensure the two tables are related, then you can do the following:

 

To add a new sum column:

_summedValues = yourTable1[column1name] + RELATED(yourTable2[column2name])

 

To add as a measure:

_summedValues = SUM(yourTable1[column1name]) + SUM(yourTable2[column2name])

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Thank you for your help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.