Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Can someone please assist me with DAX syntax for this query where I want to use an "IN" statement? I have been struggling with this and looking up information online and I cannot figure it out.
This query works in DaxStudio:
EVALUATE
FILTER(
SUMMARIZECOLUMNS(
'_Oracle Payroll GL'[OPGL Emplyee Num],
'_Oracle Payroll GL'[OPGL Full Name],
FILTER('_Oracle Payroll GL','_Oracle Payroll GL'[OPGL Element Name]="Time Entry Wages"),
FILTER('Date Of Accounting','Date Of Accounting'[Acct Yr] =2020),
"Pay Hours",calculate(sum('_Oracle Payroll GL'[pay_hours])),
"Net Amount",calculate(sum('_Oracle Payroll GL'[db_amount]))),
[Net Amount]>0
)
***********
However, when I replace this line:
FILTER('Date Of Accounting','Date Of Accounting'[Acct Yr] =2020),
with this line:
FILTER('Date Of Accounting','Date Of Accounting'[Acct Yr] IN {2020,2019}),
I get an error but DaxStudio doesn't tell me what it is.
What do I need to do in order to get this to work?
Solved! Go to Solution.
there's a syntactic equivalence,
FILTER (
'Date Of Accounting',
'Date Of Accounting'[Acct Yr] = 2019
|| 'Date Of Accounting'[Acct Yr] = 2020
)
obviously more verbose.
Meanwhile, I couldn't tell any syntactic error in that IN {2019, 2020} expression.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
there's a syntactic equivalence,
FILTER (
'Date Of Accounting',
'Date Of Accounting'[Acct Yr] = 2019
|| 'Date Of Accounting'[Acct Yr] = 2020
)
obviously more verbose.
Meanwhile, I couldn't tell any syntactic error in that IN {2019, 2020} expression.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
That worked! Thank you for your help. I will make a note of that for the future.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |