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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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