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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
wneiton
Resolver I
Resolver I

Create a new table from sum columns from existing tables

Help, please 

I need create a new table from another two or more table. 

e.g. 

I have two independent tables (no relationships) in Power BI. Each table has a column with values, and I need to sum theses values and create another table with the result of this sum. example below

 

 

Capturar.JPG

 

thanks!!

 

1 ACCEPTED SOLUTION

Hi, @Ashish_Mathur @Greg_Deckler

 

I have solved my problem using two functions: 

DISTINCT and SWITCH. 

 

1 - I've combined all my tables using append queries, created Append2 Table. 

 

2 - Second I have created new table. 

Criterios = DISTINCT(Append2[Attribute]) and 

valores = SWITCH(Criterios[Attribute];"impacto1";[Media_Impacto1];"impacto2";[Media_Impacto2];"impacto3";[Media_Impacto3];"visao1";[Media_Visao];"visao2";[Media_Visao2];"visao3";[Media_Visao3])

 

3  - Then I've pulled Attribute and valores to the visual, now I can order by valores(value)

 

ps: Media_Impacto is a previous measure that I had created for each table.

 

Wneiton

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

Hmm, I would create a table using enter data that was just a single column with the text "table01" and "table02" in it as rows. Then you could create a calculated column like:

 

Column = IF([Column]="table01",SUMX('Table1'[Column]),SUMX('Table2'[Column]))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

hi @Greg_Deckler @Ashish_Mathur

Yours example, helped me, thanks, but here's my true reality.

I need to do an arithmetic sum of all impacto1 values and create a new table as a result. e.g

 

Capturar.JPG

 

New_table

Column     |    values 

impacto1        1,6 

impacto2        2,3 

impacto3        2,8

....

impacto20      1,5 

 

Hi,

 

Drag the Attribute column to the row labels of the Table visual and filter it on "Begins with" Impacto.  Write this measure

 

=SUM(Data[Value])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

For each table I have already created a measure , now I need to combine all 20 measure from 20 tables in one new single table, like below. Automatically, with DAX formula. 

 

New_table

Column     |    values 

impacto1        1,6 

impacto2        2,3 

impacto3        2,8

....

impacto20      1,5

Hi, @Ashish_Mathur @Greg_Deckler

 

I have solved my problem using two functions: 

DISTINCT and SWITCH. 

 

1 - I've combined all my tables using append queries, created Append2 Table. 

 

2 - Second I have created new table. 

Criterios = DISTINCT(Append2[Attribute]) and 

valores = SWITCH(Criterios[Attribute];"impacto1";[Media_Impacto1];"impacto2";[Media_Impacto2];"impacto3";[Media_Impacto3];"visao1";[Media_Visao];"visao2";[Media_Visao2];"visao3";[Media_Visao3])

 

3  - Then I've pulled Attribute and valores to the visual, now I can order by valores(value)

 

ps: Media_Impacto is a previous measure that I had created for each table.

 

Wneiton

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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