Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAX FILTER function with multiple criteria

I have a DAX statement I run inside SSMS.

my original statement is:

evaluate(filter('rptLoan', [RemainingDays] <= 10))

and it works fine. I want to add another criteria as below

evaluate(filter('rptLoan', [RemainingDays] <= 10 and [CloseDt] <> "2017-01-31"))

but it is not working and I get below error

Query (1, 47) Operator or expression 'AND' is not supported in this context.

Please advise. Thank you.


1 Answers

It's simple. You can not use AND. You need to use && instead.

You also need to convert the string date to date type using DATEVALUE function

evaluate(filter('rptLoan', [RemainingDays] <= 10 && [CloseDt] <> datevalue("2017-01-31")))
like image 71
FLICKER Avatar answered Jul 25 '26 16:07

FLICKER



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!