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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Count with multiple criteria

I can see this question has been asked before. Somehow it's not working.

I want to count from "open/closed status" and "phase"

 

Open/close status criteria = "open" and "closed"

Phase = "4 - Delivery"

 

I have managed to search with one criterion only.

CALCULATE(COUNTROWS(Project), SEARCH("closed", Project[open/closed Status],,0)>0)

 

 

Capture.PNG

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@Anonymous 

= CALCULATE(
        COUNTROWS(Project),
        Project[open/closed Status] IN  {"Open", "Closed"},
        Project[Phase] = "4 - Delivery",
        Project[Est. Execution/Project start date] >= DATEVALUE("01-01-2020"),
        Project[Est. Execution/Project start date] <= DATEVALUE("31-12-2020")
)

You can also use DATE(2021,12,31)  instead of DATEVALUE("31-12-2020")

 

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

@Anonymous 

= CALCULATE(
        COUNTROWS(Project),
        Project[open/closed Status] IN  {"Open", "Closed"},
        Project[Phase] = "4 - Delivery",
        Project[Est. Execution/Project start date] >= DATEVALUE("01-01-2020"),
        Project[Est. Execution/Project start date] <= DATEVALUE("31-12-2020")
)

You can also use DATE(2021,12,31)  instead of DATEVALUE("31-12-2020")

 

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Anonymous
Not applicable

Hi @AlB 
This is working perfectly.
I also a have column with dates I would like to include e.g. >= 01-01-2020 <=31-12-2020 - can this also be done?

= CALCULATE(
        COUNTROWS(Project),
        Project[open/closed Status] IN  {"Open", "Closed"},
        Project[Phase] = "4 - Delivery",
        Project[Est. Execution/Project start date] >= "01-01-2020" & <= "31-12-2020"
)
  
AlB
Community Champion
Community Champion

Hi @Anonymous 

The condition is not completely clear. Try:

CALCULATE (
    COUNTROWS ( Project ),
    Project[open/closed Status] IN { "open", "closed" },
    Project[Phase] = "4 - Delivery"
)

or

CALCULATE (
    COUNTROWS ( Project ),
    Project[open/closed Status] = "closed",
    Project[Phase] = "4 - Delivery"
)

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.