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
JonasBDM
Regular Visitor

Sum between two columns

Hi,

 

I hope your are well. 

 

I have two table : 

First article base :

JonasBDM_0-1638371696907.png

second sales : 

JonasBDM_1-1638371725724.png

 

 

In the article base, I would like to display the sum of sales for each article. Can someone help me please ? 

Thank you in advance. 

JL6

2 ACCEPTED SOLUTIONS
ikor42
Regular 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]
  )

View solution in original post

negi007
Community Champion
Community Champion

@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




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
negi007
Community Champion
Community Champion

@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




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

shanecosgrove1
Frequent 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.
shanecosgrove1_0-1638372593700.png

 

ikor42
Regular 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]
  )

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.