Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tklausmeier
New Member

Counting occurrences with 2 filters

I am new to Power BI and I am building progress charts for our software development team. I have a table of tasks that all belong to parent projects. Some of the tasks are Closed and some are New or Active. I've already solved for counting how many tasks exist within each parent project. But now I need to solve for counting how many of the tasks within each parent project are closed. I am doing this so that we can show the percentage completion on each project. So if a project has 4 tasks, 2 are closed, then the graph will show it at 50% completion. This is an example of what my data looks like... 

TaskIDParentIDTaskStateTasksPerParentClosedTasksPerParent
58105683Closed4HELP ME
58095683Closed4 
58155683Closed4 
58115683Closed4 
58065684Closed7 
58075684Closed7 
58675684Closed7 
58135684Active7 
58735684Closed7 
58085684Closed7 
58685684Closed7 
58045685Closed2 
58055685Closed2 
57975686Closed1 
58025688Closed2 
58035688Closed2 
58195689Active7 
58805689New7 
58795689Active7 
58815689New7 
58825689New7 
58205689Active7 
58215689Active7 
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi tklausmeier,

 

To achieve your requirement, create a calculate column using DAX below:

Result = CALCULATE(COUNT(Table1[TaskID]), FILTER(ALLEXCEPT(Table1, Table1[ParentID]), Table1[TaskState] = "Closed"))

Capture.PNG  

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi tklausmeier,

 

To achieve your requirement, create a calculate column using DAX below:

Result = CALCULATE(COUNT(Table1[TaskID]), FILTER(ALLEXCEPT(Table1, Table1[ParentID]), Table1[TaskState] = "Closed"))

Capture.PNG  

 

Regards,

Jimmy Tao

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.