The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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?
Solved! Go to 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?
hi @gambleave Can you provide a sample of the data and your desired result?
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"})
)
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
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |