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

I need to count occurrences of 1 column based on multiple filters

I'm new to Power BI. I am building analytics tools to display my software development team's progress in the sprint. I have Tasks with ID's attached to a Parent Project with an ID. Each Task has a State (New, Active, Resolved, or Closed). I have already solved for counting the total number of Tasks per Parent Project. But now I need help solving for how many tasks per parent project are in Closed Status. Below is an example of what my data looks like. Can someone please help point me in the right direction? 

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-cherch-msft
Employee
Employee

Hi @tklausmeier

 

You may refer to below dax to create the calculated column. You may add +0 for it if you don't need blank rows.

ClosedTasksPerParent =
COUNTROWS (
    FILTER (
        Table,
        Table[ParentID] = EARLIER ( Table[ParentID] )
            && Table[TaskState] = "Closed"
    )
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @tklausmeier

 

You may refer to below dax to create the calculated column. You may add +0 for it if you don't need blank rows.

ClosedTasksPerParent =
COUNTROWS (
    FILTER (
        Table,
        Table[ParentID] = EARLIER ( Table[ParentID] )
            && Table[TaskState] = "Closed"
    )
)

1.png

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks so much! That worked perfectly! 🙂

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.

Top Solution Authors