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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gambleave
Helper II
Helper II

Adding further criteria to filter

This seems dead basic, but I keep getting errors with everything I try. 


I have a working measure in the form:

 

=COUNTROWS(FILTER(ClientGroup, [Account Status]=1 && ClientGroup[Tier]="Gold"))

 

(Account Status is a measure to categorize accounts based on differrent transaction volumes)

 

I want to expand the filter criteria to include Account Status values of 1, 2 or 3 as well as Tier of Gold or Silver. Can anyone please help? 

1 ACCEPTED SOLUTION

Thanks a million to you both for the help. This works perfectly. 

 

Oddly, I tried the same measure in a Power Pivot version of my project with Excel 2016, but it doesn't work there (...The syntax for 'in' is incorrect...). Is it that this DAX operator doesnt work with Excel? 

View solution in original post

7 REPLIES 7
DimaMD
Solution Sage
Solution Sage

hi @gambleave  Can you provide a sample of the data and your desired result?

 


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Afraid not, as it's in a corporate environment and I need to use my phone just to access this forum!

 

I thought this should be a measure selection/Syntax problem since it can be approached by creating additional measures for different permutations of Account Status and Tier, then adding them together. 

@gambleave  Try it

CALCULATE(
        COUNTROWS('ClientGroup'), 
        FILTER(ClientGroup, [AccountStatus] in {"1","2","3"}  && ClientGroup[Tier] in { "Gold", "Silver"})
      )

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Thanks for the suggestion. For some reason, I end up with the error "MdxScript(Model) (257,105) Calculation error in measure ...Function 'CONTAINSROW' does not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values. 

[AccountStatus] in {1,2,3}

Thanks a million to you both for the help. This works perfectly. 

 

Oddly, I tried the same measure in a Power Pivot version of my project with Excel 2016, but it doesn't work there (...The syntax for 'in' is incorrect...). Is it that this DAX operator doesnt work with Excel? 

@gambleave  Check the data format, numeric or text


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.