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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Show sum of a group on tabel base

Hi I hope I can explain well what I am trying to achieve.
I have 3 tables which I am trying to link together.

In the Salesline I have many lines with the same Item and sold Quantity.

In The Warehouse i also have many lines with the Same Item and the stored Quantity. 

TobiasMayer_2-1666297880892.png

(Red colums are not availabel in the datasource at the Moment.)

I would need the sum of theses two Quantitys and subtract them from Each other. 

I want to show the individual saleslines from my sales filterd by Item.
At the end of the tables I want to see how many parts are left in my stock.
So in my target table for the same ItemID in each line should be the same value.

TobiasMayer_3-1666297898579.png

 

I tried it with verious measures or adding the grouped Sum in the datasource but could not find a way to make it work.

I hope its understandable. 

Thank you for your help!

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
I guess the number should be 50 i.e. (10 + 40) not 30

Please try the following measures

Quantity Sum =
CALCULATE (
    SUM ( Salesline[Quantity] ),
    REMOVEFILTERS (),
    VALUES ( Sales[Item] )
)
Warehouse Sum =
CALCULATE (
    SUM ( Warehouse[Warehouse] ),
    REMOVEFILTERS (),
    VALUES ( Sales[Item] )
)

 

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Anonymous 
I guess the number should be 50 i.e. (10 + 40) not 30

Please try the following measures

Quantity Sum =
CALCULATE (
    SUM ( Salesline[Quantity] ),
    REMOVEFILTERS (),
    VALUES ( Sales[Item] )
)
Warehouse Sum =
CALCULATE (
    SUM ( Warehouse[Warehouse] ),
    REMOVEFILTERS (),
    VALUES ( Sales[Item] )
)

 

Anonymous
Not applicable

Hi @tamerj1

yes of cause i meant that.

Thank you very much that was the perfect soulution!!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.