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

create calculated column based on 3 tables

i have 3 tables as follows 

table 1 : 

C3FFFDD6-6DD2-4C3D-AFF9-4954FF00A84F.png

 

table 2 : 

7320B81F-E2B6-445B-96FE-9F9E1BBB489F.png

 

table 3 : 

37FD00F9-B128-41AF-BEDC-8B59709510EB.png

 

i need to get the sum of table1[value] and instert it as a column in table[3] as i will make extra calculations after this

Relations are as follows:

table1[code] & table2[code] , many to one.

table2[type] & table3[type] , one to many.

 

id column in table1 and table 3 has duplicates 

 

 

1 ACCEPTED SOLUTION

@mhusaein 

Please try

CalculatedColumn =
SUMX (
FILTER (
CALCULATETABLE ( table1, CROSSFILTER ( table2[type], table3[type], BOTH ) ),
table1[id] = table3[id]
),
table1[value]
)

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @mhusaein 

what are the cardinalities of these relationships? Which ones are active and which are in inactive?

Hi @tamerj1 , i updated table 2 , doesn't contain an id column now.

also added more details about the tables relations in the original post

@mhusaein 

Please try

CalculatedColumn =
SUMX (
FILTER (
CALCULATETABLE ( table1, CROSSFILTER ( table2[type], table3[type], BOTH ) ),
table1[id] = table3[id]
),
table1[value]
)

thanks @tamerj1  it worked perfectly 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.