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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
borniex
Frequent Visitor

Parent child calculation

Hello!
It seems like a simple task but I can't figure it out, has anyone encountered this problem?
I am attaching a clear example. How can I calculate the two columns?sum_column.JPG

1 ACCEPTED SOLUTION
barritown
Solution Sage
Solution Sage

Hello @borniex,

Assuming, the tables are not related in your data model, I could propose to create a couple of calculated columns like this one:

barritown_0-1698090716644.png

In plain text:

sum_parent = 
VAR CurrentParent = [parent] 
RETURN SUMX ( FILTER ( Data, [product] = CurrentParent ), [value] )

sum_child = 
VAR CurrentChild = [child]
RETURN SUMX ( FILTER ( Data, [product] = CurrentChild ), [value] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

View solution in original post

3 REPLIES 3
barritown
Solution Sage
Solution Sage

Hello @borniex,

Assuming, the tables are not related in your data model, I could propose to create a couple of calculated columns like this one:

barritown_0-1698090716644.png

In plain text:

sum_parent = 
VAR CurrentParent = [parent] 
RETURN SUMX ( FILTER ( Data, [product] = CurrentParent ), [value] )

sum_child = 
VAR CurrentChild = [child]
RETURN SUMX ( FILTER ( Data, [product] = CurrentChild ), [value] )

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

 

Thank you, the solution works! How and what should be transformed so that I can make it dynamic with a measure?

In case you use a table visual for that, such measures will do:

sum_parent = 
VAR CurrentParent = MIN ( Relationship[parent] )
RETURN SUMX ( FILTER ( Data, [product] = CurrentParent ), [value] )

sum_child = 
VAR CurrentChild = MAX ( Relationship[child] )
RETURN SUMX ( FILTER ( Data, [product] = CurrentChild ), [value] )

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.