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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AshDil
Helper V
Helper V

Want to show sum of value based on 5 different columns from 2 different tables

Hi,

 

I have 2 tables in which, I want to get total sum based on 5 columns. So I have tried with following formula it is throwing error.

EVALUTE(SUMMARIZECOLUMNS('TABLE1'[ORDER_NO],'TABLE1'[QUE_NO],'TABLE2'[QUE_NO],'TABLE2'[ID],'TABLE2'[CUST_ID],'TABLE1'[CUST_NAME],'TABLE1'[DATE],SUM('TABLE2'[SALES])

 

Please hlep me to do it.

Thanks,

AshDil

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @AshDil 

Do you want to calculate the total based on many different columns in two tables?

There could be only one active relationship between two tables. Here I suggest you to create a Newkey columns in two tables for calculation.

1.png

NewKey are calculated columns.

NewKey = COMBINEVALUES(",",Table1[Order_no],Table1[Column2],Table1[Column3])
NewKey = COMBINEVALUES(",",Table2[Order_no],Table2[Column2],Table2[Column3])

Measure:

Total = SUMX(FILTER(ALL(Table2),Table2[NewKey] in VALUES(Table1[NewKey])),Table2[Value]) 

Result is as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
TheoC
Super User
Super User

Hi @AshDil 

 

Are you able to provide a little more detail about what you're wanting?  

 

If you are after the Total Sum, you can use the measure "Total Sum = SUM ( 'TABLE2'[SALES] )"

 

From there, all you need to do is use a Table visual from the Visualizations pane, drag the columns you want in the Table, and then drag the measure "Total Sum" at the end of the table.

 

Just please make sure that you have a one to many relationship (single direction) from Table1 to Table2 using the [ORDER_NO] field as the relationship.

 

Hope that helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Hi @TheoC ,

 

I have many to many relationship between table 1 and table 2.

So please guide me to achieve this.

 

Thanks,

AshDil

Hi @AshDil what is the unique ID in your Table 1 and what is the relationship between your Table 1 and Table 2?

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Hi @TheoC ,

 

The unique column is Order_no, relation between table 1 and table 2 is many to many based on this column.

 

Thanks,

AshDil

Hi @AshDil 

 

Okay, thanks for letting me know.

 

Now, all you need to do is use a Table visual from the Visualizations pane, drag the columns you want in the Table, and then drag the measure "Total Sum" at the end of the table.

 

Thanks heaps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Hi @TheoC ,

 

I want to show that value in KPI card, the total sum value must be based on the above mentioned columns.

Sorry for troubling,Please help me if any other way to resolve it.

Thanks,

AshDil

Anonymous
Not applicable

Hi @AshDil 

Do you want to calculate the total based on many different columns in two tables?

There could be only one active relationship between two tables. Here I suggest you to create a Newkey columns in two tables for calculation.

1.png

NewKey are calculated columns.

NewKey = COMBINEVALUES(",",Table1[Order_no],Table1[Column2],Table1[Column3])
NewKey = COMBINEVALUES(",",Table2[Order_no],Table2[Column2],Table2[Column3])

Measure:

Total = SUMX(FILTER(ALL(Table2),Table2[NewKey] in VALUES(Table1[NewKey])),Table2[Value]) 

Result is as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors