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
vinicius_ramos
Helper III
Helper III

Create a row in the table with the sum

Hello, 

 

I want to do a table, that have a sum of a colunm in the table. For Example:

 

I have this table:

Code Total
1 10
2 20
3 30
4 40
5 50

 

And i try to create a row that have a sum of Total Colunm:

 

Code Total
1 10
2 20
3 30
4 40
5 50
1+2+3+4+5 150

 

This is possible to do in DAX or in a power Query?

 

Thanks a lot

1 ACCEPTED SOLUTION

@vinicius_ramos 

Actually it was like this before I edit it after having a 2nd read. Please use

NewTable =
UNION ( Table1, { ( "Total", SUM ( Table[Total] ) ) } )

View solution in original post

4 REPLIES 4
vinicius_ramos
Helper III
Helper III

@tamerj1 

 

Thank you very much!!

tamerj1
Super User
Super User

Hi @vinicius_ramos 
With DAX you can create a new calculated table 

 

NewTable =
UNION ( Table1, { ( SUM ( Table[Code] ), SUM ( Table[Total] ) ) } )

 

 

If you have multiple coulmns in the original table then it needs some changes. 

Hi, @tamerj1 

 

I have a question, if instead of Sum the "Code" column, I wanted to put the name "Total Code". In the code changes " SUM ( Table[Code] )" for what?

 

For Example: 

 

Code Total
1 10
2 20
3 30
4 40
5 50
Total Code 150

 

Do you can help me?

 

Thanks a lot.

@vinicius_ramos 

Actually it was like this before I edit it after having a 2nd read. Please use

NewTable =
UNION ( Table1, { ( "Total", SUM ( Table[Total] ) ) } )

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.

Top Solution Authors