# Total Of All The Child Of The Parent-DAX



## Madel (Feb 11, 2017)

Hi All,
This's My 1st Time In This Great Site.
I Want To Make It As Calculated Column Not a Measure 
The Table As Below :

Parent------   Child------     QTY-Child
P1------------          CH1------------        6
P2------------           CH2------------         5
P1------------           CH3------------         2
P1------------           CH4------------         1
P2------------           CH5------------         0

To be:
Parent--------------------Child--------------------Child   QTY-------------TotalChildOfTheParent
P1------------------------ CH1------------------------ 6------------------------ 9
P2------------------------ CH2------------------------ 5------------------------ 5
P1------------------------ CH3------------------------ 2------------------------ 9
P1------------------------ CH4------------------------ 1------------------------ 9
P2------------------------            CH5------------------------ 0------------------------ 5


----------



## Matt Allington (Feb 11, 2017)

Madel said:


> I Want To Make It As Calculated Column Not a Measure



Why do you want to do that? These 2 columns are a different levels of granularity and they don't belong in the same table.


----------



## Madel (Feb 12, 2017)

Thank You FY Interesting,

1- QTY=Sold QTY Not Stock QTY.
2-The Parent Can Be Sold As It's Parent And It Can Convert To Child
So, I Need It As It's
If You Can Support.


----------



## Madel (Feb 12, 2017)

OK Dears,
Resolved By The Below :
=CALCULATE(SUM(Table[Column QTY]),ALLEXCEPT(Table,Table[Column Of Parent]))


----------



## neb255 (Apr 3, 2018)

Madel said:


> OK Dears,
> Resolved By The Below :
> =CALCULATE(SUM(Table[Column QTY]),ALLEXCEPT(Table,Table[Column Of Parent]))



Thank you! i have been searching Power BI forums trying to get to this for a week now. 

@Matt, one other reason to have these in the same table is so that you can use it as a ranking to show all child rows of the parent by parent rank.


----------

