Forum Discussion
mjcuccia
7 years agoFrequent Visitor
hierarchy row counts
I have a need to get the row count for a particular level in my hierarchy to use that value in each child row of that hierarchy level. In the example below, I would want the number of rows under ...
- 7 years ago
cant test to guarantee , but you can try something like this
hier-count = CALCULATE( DISTINCTCOUNT( mytable[id] ) ,ALLEXCEPT(myTable , myTable[Grove]) )hope this is understandable :)
mjcuccia
7 years agoFrequent Visitor
You can ignore OEM rank for the level at which Grove sits. That rank only applies to the actaul OEM's which are under Grove.
I simply need on each row under Grove to acquire the row count of distinct OEM's only under Grove (this formula would be used for all other sites in the hierarchy as well), but in the example pic just Grove for now). The count of distinct rows for Grove should come out to 7 to be used in a DAX formula on each row under Grove.
Nickgastaldi
7 years agoResolver I
cant test to guarantee , but you can try something like this
hier-count =
CALCULATE( DISTINCTCOUNT( mytable[id] )
,ALLEXCEPT(myTable ,
myTable[Grove])
)hope this is understandable :)
- mjcuccia7 years agoFrequent Visitor
Crushed it! Thanks Nickgastaldi! Answer was like this:
hier-count = CALCULATE( DISTINCTCOUNT( mytable[OEM] ) ,ALLEXCEPT(myTable , myTable[Site]) )