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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Create a summary table

Hello,

 

I have two tables with différent type of code, each table has a code, an amount column and a date table. 

I want to create a third table wich is a summary of the previous one.

 

With 5 columns : 

- Month

- Countrows of the first table

- Sum of the amount from the first table

- Countrows of the second table

- Sum of the amount from the second table

 

I created a pbix file in order to give you some view over my datas.

 

Best regard,

 

ScrappyS

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Add this code to a calulated table:

Table = 
NATURALINNERJOIN(
SUMMARIZE(ADDCOLUMNS('Table 1' , "Month_" , MONTH('Table 1'[Month])) , [Month_] , "Countrows T1" , COUNTROWS('Table 1') , "SUM CA T1" , SUM('Table 1'[CA]))
,
SUMMARIZE(ADDCOLUMNS('Table 2' , "Month_" , MONTH('Table 2'[Month])) , [Month_] , "Countrows T2" , COUNTROWS('Table 1') , "SUM CA T2" , SUM('Table 1'[CA]))
)

 

image.png

Br,

J


Connect on LinkedIn

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , you can append merge and group by

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

https://www.poweredsolutions.co/2019/07/30/grouping-rows-with-power-bi-power-query/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
tex628
Community Champion
Community Champion

Add this code to a calulated table:

Table = 
NATURALINNERJOIN(
SUMMARIZE(ADDCOLUMNS('Table 1' , "Month_" , MONTH('Table 1'[Month])) , [Month_] , "Countrows T1" , COUNTROWS('Table 1') , "SUM CA T1" , SUM('Table 1'[CA]))
,
SUMMARIZE(ADDCOLUMNS('Table 2' , "Month_" , MONTH('Table 2'[Month])) , [Month_] , "Countrows T2" , COUNTROWS('Table 1') , "SUM CA T2" , SUM('Table 1'[CA]))
)

 

image.png

Br,

J


Connect on LinkedIn
Anonymous
Not applicable

Thanks a lot @tex628 , it's work like a charm !

 

I have just another question : how can i add to my summary table a column wich is the difference between 'table 1'[Sum CA] and 'table 2'[Sum CA] ?

 

('table 1'[Sum CA] - 'table 2'[Sum CA])

 

Best regards,

 

ScrappyS

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.