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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors