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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
InsHunter
Helper II
Helper II

Reconcilation of values between parent and child -Calculated column

Hi,
Request your support on formulating the correct DAX formula for caclulated column which calculates the value of sum of the children of that Node. There are more than five levels of parent ,child relation ship.Reconciliation need to happen for all parents with their immediate next level children. The generated table is as below 

InsHunter_0-1690894563272.png

My dax formula for the calculated column "Units_Expected" is not giving values correctly as its aggregating totally. In this sample only three levels are shown but acutal data has more levels. I request a generic formula for any number of levels.

Units_Expected =

if(
    Units_Reconciliation_Table[Node Type]="level1",
    sumx(
        FILTER(Units_Reconciliation_Table,PATHITEM(Units_Reconciliation_Table[Entity Path],2,INTEGER) =Units_Reconciliation_Table[Child Node ID]),
        Units_Reconciliation_Table[Units_Actuals]),
        (  
   
    if(Units_Reconciliation_Table[Node Type]="level2",
    sumx(
        FILTER(Units_Reconciliation_Table,        
        AND(
        PATHITEM(Units_Reconciliation_Table[Entity Path],3,INTEGER) =Units_Reconciliation_Table[Child Node ID],
        PATHITEM(Units_Reconciliation_Table[Entity Path],2,INTEGER) =Units_Reconciliation_Table[Immediate_Parent])),      

        Units_Reconciliation_Table[Units_Actuals]),
        if(Units_Reconciliation_Table[Node Type]="level3",
    sumx(
        FILTER(Units_Reconciliation_Table,PATHITEM(Units_Reconciliation_Table[Entity Path],4,INTEGER) =Units_Reconciliation_Table[Child Node ID]),
        Units_Reconciliation_Table[Units_Actuals]),
    if(Units_Reconciliation_Table[Node Type]="level4",
    sumx(
        FILTER(Units_Reconciliation_Table,PATHITEM(Units_Reconciliation_Table[Entity Path],5,INTEGER) =Units_Reconciliation_Table[Child Node ID]),
        Units_Reconciliation_Table[Units_Actuals])
    )
    )
    )))

Appreciate your help . Thanks in advance.



 

 

2 ACCEPTED SOLUTIONS
InsHunter
Helper II
Helper II

Could simplify the DAX and achieve the objective and it can work for any number of levels.Sorry for over complicating the things initally.

Units_Expected =
VAR Node_ID=[Child Node ID]
RETURN
    sumx(
        FILTER(Units_Reconciliation_Table,        
                (Units_Reconciliation_Table[Immediate_Parent] =Node_ID)),  
         Units_Reconciliation_Table[Units_Actuals])

View solution in original post

InsHunter_0-1690911727952.png

Pl see the outcome of the calculated columns in the generated table

View solution in original post

2 REPLIES 2
InsHunter
Helper II
Helper II

Could simplify the DAX and achieve the objective and it can work for any number of levels.Sorry for over complicating the things initally.

Units_Expected =
VAR Node_ID=[Child Node ID]
RETURN
    sumx(
        FILTER(Units_Reconciliation_Table,        
                (Units_Reconciliation_Table[Immediate_Parent] =Node_ID)),  
         Units_Reconciliation_Table[Units_Actuals])

InsHunter_0-1690911727952.png

Pl see the outcome of the calculated columns in the generated table

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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