Forum Discussion
csfemco
6 years agoFrequent Visitor
Count completed task by concept
Hi, I think this is pretty easy but I just can't get it. I have this data: Project Task Status %Completed A A1 "Completed" ...
- 6 years ago
Hi csfemco ,
Try this measure, it might seem complex but it does the trick 🙂
% Full Completed Projects = VAR _tmpTable = ADDCOLUMNS(VALUES( Projects[Project ] ), "IsCompleted", VAR _curProject = [Project ] RETURN IF(COUNTROWS(FILTER(Projects, Projects[Project ] = _curProject && Projects[Status ] <> "Completed")) =0, TRUE, FALSE)) VAR _projectsCompeted = COUNTROWS(FILTER(_tmpTable, [IsCompleted] = TRUE())) VAR _totalProjects = COUNTROWS(_tmpTable) RETURN DIVIDE(_projectsCompeted, _totalProjects)Basically, I create a table with all project names and see if they are completed or not (if a project has a row with something other then "completed", then at least one task is not completed. Then I count the 'true' rows and all rows and divide those two numbers.
Does this help you? Let me know!Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
az38
6 years agoCommunity Champion
Hi csfemco
create 2 measures
isFullComplete =
var _countTasks = CALCULATE(COUNTROWS('Table');ALLEXCEPT('Table';'Table'[Project]))
var _countTasksCompleted = CALCULATE(COUNTROWS('Table');ALLEXCEPT('Table';'Table'[Project]);'Table'[Status]="Completed")
RETURN
IF(_countTasks=_countTasksCompleted; TRUE(); FALSE())and then
% Completed =
DIVIDE(
CALCULATE(DISTINCTCOUNT('Table'[Project]);FILTER(ALL('Table');[isFullComplete]=TRUE()));
CALCULATE(DISTINCTCOUNT('Table'[Project]);ALL('Table'))
)
do not hesitate to give a kudo to useful posts and mark solutions as solution