Given the table of data (which is helpful), Rémi's answer is close to what I would suggest.
SUMX(SUMMARIZE(TableName, [Wagon and Nu], [Total wagon capacity]), [Total wagon capacity])
*changing TableName to the actual name of your table.
The SUMMARIZE creates a filtered table with just the DISTINCT values of [Wagon and Nu] and [Wagon Capacity]. In other words, it gets rid of the duplicate rows (based on the 2 columns listed), then sums the capacity of the remaining unique rows.
In other words:
is turned into simply
And the 2nd column is then summed (which is this small example becomes 6).
If you have any choice over how the data is stored though, I'd recommend splitting your data into two actual tables. In one table, have the ID, [Order Date], Pack, Container, [Wagon & Nu] only. In another table have [Wagon & Nu], Wagon, Number and Capacity split out. In this 2nd table (the lookup table), you only need one row per [Wagon & Nu]. Join the two tables on the key field [Wagon & Nu] and in this situation, a simple SUM on capacity would work.
SUMX is required to specify the table using SUMMARIZE. I couldn't get plain SUM to work with SUMMARIZE.
Performance wise, the SUMX is iterating over the rows of the summarized table, not the entire table. (Still not ideal though)
I'm certainly not saying that mine is the only (or even the best) solution though. Several of the solutions above (especially yours, ALeef, with CALCULATE and FILTER) seemed like they should work, even though I struggled. I figured if I struggled, the OP might too, so I added my 2 cents.
And honestly, reorganizing the data so there's a [wagon & num] lookup table would be the best solution. Lookup tables will pay dividends over & over again as the data model gets more complex.