Forum Discussion
JonasBDM
4 years agoRegular Visitor
Sum between two columns
Hi, I hope your are well. I have two table : First article base : second sales : In the article base, I would like to display the sum of sales for each article. Can so...
- 4 years ago
Hi,
depends if there is a relationship between tables.If exists - simply add new column as
Sales =SUMX (RELATEDTABLE ( sales ),sales[QTE]
)If there is no relationship just add column as:Sales =VAR _current_art = 'Article Base'[ART]RETURNSUMX (FILTER ( sales, sales[Art] = _current_art ),sales[QTE]) - 4 years ago
JonasBDM you just need to create relationship between these two tables on ART columns of both tables. then you use the ART column from the first table and QTE from the second table in the matrix visual. you will get sum by ART. there is no need to create any measure but relationship between tables will do the job. thanks
shanecosgrove1
4 years agoFrequent Visitor
Hi,
You could use a dax function to add a new column called Sum of Sales to the Article table.
Sum of Sales = CALCULATE(Sum('Sales'[QTE]),FILTER('Sales','Sales'[Art] = Article[ART]))
The above will yield the below results.