Forum Discussion
Anonymous
2 years agoNot applicable
Parent Child Merge Calculation
I have a dax code the get the relationship for parent and child Relation = CONCATENATEX(FILTER('Table',PATHCONTAINS(PATH('Table'[Child],'Table'[Parent]),EARLIER('Table'[Child]))),'Table'[Child]...
- 2 years ago
P is a calculated column
P = path('Table'[Child],'Table'[Parent])Res is a measure
Res = var c = SELECTEDVALUE('Table'[Child]) var a= SUMMARIZE(ALLSELECTED('Table'),[Value],[P]) var b= ADDCOLUMNS(a,"inc",IF(PATHCONTAINS([P],c),[Value])) return sumx(b,[inc])
Anonymous
2 years agoNot applicable
lbendlin , hi again, i use the same code to count the values
ResCount =
var c = SELECTEDVALUE('Table'[Child])
var a= SUMMARIZE(ALLSELECTED('Table'),[Value],[P])
var b= ADDCOLUMNS(a,"inc",IF(PATHCONTAINS([P],c),[Value]))
return COUNTX(b,[inc])
can you help me to count only the values that is more than zero or not null values on the column Value.
lbendlin
Super User
2 years agoPlease provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
- Anonymous2 years agoNot applicable
lbendlin hi again, below should be the output table in column Result_Count and Result_Sum
I also have an issue, error showing, if i change the child and parent value as text.
Is there's a way that instead of showing in column Relation as Child/Parent as number should be the child/parent name instead. Thanks again.
- lbendlin2 years ago
Super User
Can you please post in a usable format? I can't work with screenshots.
- Anonymous2 years agoNot applicable