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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.