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
ikor42
4 years agoRegular Visitor
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]
RETURN
SUMX (
FILTER ( sales, sales[Art] = _current_art ),
sales[QTE]
)