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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Parent/Child With SUMX

I have multiple tables that have parent/child relationships within them. I have created PATH column in each one of them and created a measure to be able to see the summed up value for the nodes as per here.

But I have a header table that can link several of the companies and label them lets say east or west in this example. I would like to see the sum of whole east node that consist of Company A and Company C. Here is the Power BI file for reference.

 

Here is the screenshot of tables and output I need. The top section contains incoming tables. Bottom left is summation within the first table as described in the forum link above. Bottom right is the table that I need but without Company Column in there and only one row for East/West.

Output I want to see: East 1050; West 600

2019-10-16 06_05_03-Headers With Path - Power BI Desktop.png

 

Note in my modelling I won't be able to connect the Headers table to Sales table as in my real problem I have Sales table at the center surrounded with multiple Master Data with Parent/Child hierarchy in each Master Data. One Header table can not be connected to all the Master Data tables that are filtering one central Key Figure table. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Resolved by having two measures. One that filters row by row and other that does SUMX on that measure.

Measure 3 = 
VAR c =
    SELECTEDVALUE ( Headers[Company] )
RETURN
    CALCULATE (
        SUM ( Sales[Sales] ),
        PATHCONTAINS ( Sales[Path], c )
    )
Measure 4 = sumx(Headers, [Measure 3])

File updated.

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

What results do you expect to receive? Like the result in that case? You could use a table to describe it.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

Updated.

Anonymous
Not applicable

Resolved by having two measures. One that filters row by row and other that does SUMX on that measure.

Measure 3 = 
VAR c =
    SELECTEDVALUE ( Headers[Company] )
RETURN
    CALCULATE (
        SUM ( Sales[Sales] ),
        PATHCONTAINS ( Sales[Path], c )
    )
Measure 4 = sumx(Headers, [Measure 3])

File updated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.