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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is 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.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

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