Forum Discussion
understanding countx and sumx
- 2 years ago
SBR1D , Based on what I got. Check meaning in comment
Use calculate when you use calculation in expression when you use a formula else use measure
count x example 1 = COUNTX(LearningPlan,calculate(COUNT(LearningPlan[LearnerID]))) // This one just count the row value and count it againBetter to use COUNT(LearningPlan[LearnerID])
sum x example 1 = sumx(VALUES(LearningPlan[Employer name]),calculate(COUNT(LearningPlan[LearnerID]))) // Do the count till employee name level and post that sumsumx(VALUES(LearningPlan[Employer name]),[count_x test])
// Do the count till employee name level and post that sum
in progress count = COUNTX(VALUES(LearningPlan[EmployerID]),CALCULATE(COUNT(LearningPlan[EmployerID]),LearningPlan[Status] = "In Progress"))
// Do the count till employee name level and post that count again, means every value will be treated as 1
SBR1D , Based on what I got. Check meaning in comment
Use calculate when you use calculation in expression when you use a formula else use measure
count x example 1 = COUNTX(LearningPlan,calculate(COUNT(LearningPlan[LearnerID]))) // This one just count the row value and count it again
Better to use COUNT(LearningPlan[LearnerID])
sum x example 1 = sumx(VALUES(LearningPlan[Employer name]),calculate(COUNT(LearningPlan[LearnerID]))) // Do the count till employee name level and post that sum
sumx(VALUES(LearningPlan[Employer name]),[count_x test])
// Do the count till employee name level and post that sum
in progress count = COUNTX(VALUES(LearningPlan[EmployerID]),CALCULATE(COUNT(LearningPlan[EmployerID]),LearningPlan[Status] = "In Progress"))
// Do the count till employee name level and post that count again, means every value will be treated as 1