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
SimuQuery
Frequent Visitor

How to filter by 2 states at once

Remaining tasks = CALCULATE(COUNTROWS('Data source 1'),
KEEPFILTERS('Data source 1'[State]="New" OR [State]="Active"))
 
Why is this count function not working? How do I summise both? Or would I have to do them in seperate measures and bring them together? 
 
Thanks!
1 ACCEPTED SOLUTION
ZhangKun
Super User
Super User

You should use || or {} instead of OR.

Remaining tasks = 
CALCULATE(
    COUNTROWS('Data source 1'),
    KEEPFILTERS('Data source 1'[State] IN {"New", "Active"})
)

Remaining tasks = 
CALCULATE(
    COUNTROWS('Data source 1'),
    KEEPFILTERS('Data source 1'[State] = "New" || 'Data source 1'[State] = "Active")
)

 

View solution in original post

1 REPLY 1
ZhangKun
Super User
Super User

You should use || or {} instead of OR.

Remaining tasks = 
CALCULATE(
    COUNTROWS('Data source 1'),
    KEEPFILTERS('Data source 1'[State] IN {"New", "Active"})
)

Remaining tasks = 
CALCULATE(
    COUNTROWS('Data source 1'),
    KEEPFILTERS('Data source 1'[State] = "New" || 'Data source 1'[State] = "Active")
)

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors