Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I authored a query with two IF statements where I used two boolean expressions respectively as condition and result, to my surprised, the value2 returned a "Flase" when I think it should be BLANK(). When I put the BLANK() in the 3rd parameter as value1, the it gets a right result "True".
the code is here: https://dax.do/d1lbobLn8I35w4/
can anyone explain what's happening inside DAX? thanks a lot
Solved! Go to Solution.
Hi @sangjinhong
The short answer is that BLANK() is not an allowed value for any expression that is cast as Boolean type, and will automatically be converted to false.
With your two sample expressions, they are both cast as Boolean since one of the branches of IF returns a Boolean.
You can also demonstrate the behaviour with this query:
EVALUATE
{ CONVERT ( BLANK (), BOOLEAN ) }
Check out this article, specifically the section "Handling BLANK in Boolean expressions".
Regards,
Owen
Hi @sangjinhong
The short answer is that BLANK() is not an allowed value for any expression that is cast as Boolean type, and will automatically be converted to false.
With your two sample expressions, they are both cast as Boolean since one of the branches of IF returns a Boolean.
You can also demonstrate the behaviour with this query:
EVALUATE
{ CONVERT ( BLANK (), BOOLEAN ) }
Check out this article, specifically the section "Handling BLANK in Boolean expressions".
Regards,
Owen
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
8 | |
7 |