cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mholsen Member
Member

Count column text value filtered by two other columns

Hi there.

 

I have a 'Task' table where I need to count the number of times the text "Not completed" appears in the 'Task progress' column.

The count needs to be limited by the text values of the other table columns 'Critical Task' and 'Overdue' both being "True".

 

I have tried with COUNTAX() and FILTER, but I never seem to get the correct result.

 

Any ideas on how to count the number of not completed tasks that are also critical and overdue?

1 ACCEPTED SOLUTION

Accepted Solutions
vanessafvg Super Contributor
Super Contributor

Re: Count column text value filtered by two other columns

what does your statemetn look like?

 

test =
CALCULATE (
    COUNTROWS ( table ),
    FILTER (
        table,
        table[taskprogress] = "Not Completed"
            && table[CriticalTask] = "True"
            && table[Overdue] = "True"
    )
)


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
3 REPLIES 3
vanessafvg Super Contributor
Super Contributor

Re: Count column text value filtered by two other columns

what does your statemetn look like?

 

test =
CALCULATE (
    COUNTROWS ( table ),
    FILTER (
        table,
        table[taskprogress] = "Not Completed"
            && table[CriticalTask] = "True"
            && table[Overdue] = "True"
    )
)


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!
Mholsen Member
Member

Re: Count column text value filtered by two other columns

Your solution works perfectly!

Can you explain the difference between using the FILTER function and just adding the filters at the end as part of the CALCULATE  function?

 

Like Calculate (expression, filter 1, filter 2, filter 3)

vanessafvg Super Contributor
Super Contributor

Re: Count column text value filtered by two other columns

@Mholsen not quite sure what you asking but this should be informative

 

https://www.sqlbi.com/articles/filter-arguments-in-calculate/


Did I answer your question? Mark my post as a solution.
Proud a to be a Datanaut!

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 180 members 1,822 guests
Please welcome our newest community members: