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
Anonymous
Not applicable

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
vanessafvg
Super User
Super User

what does your statemetn look like?

 

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





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
vanessafvg
Super User
Super User

what does your statemetn look like?

 

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





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

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)

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

 

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





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.