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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
FarmaVip
Regular Visitor

Problem: Summing Values from another Table, only using Mesures.

Hi guys,

I want to change my connections in power bi from import to direct query, for that I need to find  a solution to this problem that only envolve mesures and not adding columns to my data.

 

 

I have 2 tables in my model

 

Table 1 - (name: Infoprex - Olivais) - Table that shows product information (ID, Price, margin, etc...)

FarmaVip_2-1664737468365.png

 

 

 

Table 2 - Table with Sales information, (ID of the product, name, price, Date of the sale, etc...)

FarmaVip_1-1664737321057.png

 

Both tables are connected by product ID (one to one connection).

 

What do I want to do?

 

I want to sum the margin (Column: "Margem") of all products sold (Table 2).

The problem is the margin ("Margem") column is only available in Table 1.

 

My "old" solution was to creat a  Column in Table 2 and getting the Margin column from Table 1 using the Related Function and then sum it (in red in the image above).

 

But I want another solution that  uses only mesures.

Can someone help me 😄 ?

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@FarmaVip Perhaps I am missing something. Why is it not just SUM('Table 2'[Margem]) ? That would be the sum of all Margem in Table 2. If you put NOM from table 1 in a visualization along with that measure then as long as there is a relationship between the two you will get the sum of the Margem for each product.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

Because "Table 2'[Margem] is a custom column that I create that take the values from Table 1[Margem]  using the Related function. I want to do this withou creating any custom column.

 

I want to use Direct Query to connect my data. That way I can't creat or modify any data inside powerbi (and creat new columns). So I have to use mesures to solve this problem.

FarmaVip_0-1664749838637.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.