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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

data in two tables

Hi

 

I have two tables containing new sales and service disconnections

 

table 1)

date, sales man, sales amount in euro

 

table 2)

date, sales man, disconnection amount  euro

 

I want to get a graph that shows net amounts (total monthly sales - total monthly disconnections) per month per salesman

 

BR

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You should add the month columns in your two tables, and UNION all the rows to one table, calculate the net amounts based on the new table. I try to reproduce your scenario and get expected results as follows.

First, add month calculated columns in the two table, mark all the disconnection amount negative using the formulas.

 

month = MONTH(Table7[Date])
month = MONTH(Table8[Date])
negative = 0-Table8[disconnection amount]


1.png2.png

Second, union all the rows into one table using the following formula and get the new table shown in screenshot.

New = UNION(Table7,SELECTCOLUMNS(Table8,"Date",Table8[Date],"salesMan",Table8[sales man],"salesAmount",Table8[negative],"month",Table8[Month]))

 

3.png

Finally, create a measure used to calculate the net amount per month per salesman, and create a clustered chart. In the following screenshot, in each month, you will see different customer’s net amount. The data below the axis show the net amount is negative.

 

Net amount = CALCULATE(SUM(New[sales amount]),ALLEXCEPT(New,New[month],New[sales man]))

 
4.png


Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You should add the month columns in your two tables, and UNION all the rows to one table, calculate the net amounts based on the new table. I try to reproduce your scenario and get expected results as follows.

First, add month calculated columns in the two table, mark all the disconnection amount negative using the formulas.

 

month = MONTH(Table7[Date])
month = MONTH(Table8[Date])
negative = 0-Table8[disconnection amount]


1.png2.png

Second, union all the rows into one table using the following formula and get the new table shown in screenshot.

New = UNION(Table7,SELECTCOLUMNS(Table8,"Date",Table8[Date],"salesMan",Table8[sales man],"salesAmount",Table8[negative],"month",Table8[Month]))

 

3.png

Finally, create a measure used to calculate the net amount per month per salesman, and create a clustered chart. In the following screenshot, in each month, you will see different customer’s net amount. The data below the axis show the net amount is negative.

 

Net amount = CALCULATE(SUM(New[sales amount]),ALLEXCEPT(New,New[month],New[sales man]))

 
4.png


Best Regards,
Angelia

Anonymous
Not applicable

Angelia

 

super. thanks for that.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.