Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I need to build a calculated column (numeric data type) using IF statement and I need to insert "null" value if condition is met. How to do it in DAX please?
If I use: Score = if('Key Measures'[Score A]=0;"null";'Key Measures'[Score A]) or Score = if('Key Measures'[Score A]=0;"";'Key Measures'[Score A])
I get error: Expressions that yield variant data-type cannot be used to define calculated columns.
Which is obvious because I mix numeric and text data types.
But how can I insert null/blank value to the cell using DAX? Insert 0 is not solution for me in this case 😞
Solved! Go to Solution.
Hey,
I'm not sure what the result is that you'd like to get, but with the following formula, you can get blank values :
Score A = if('Key Measures'[Score A]=0;BLANK();'Key Measures'[Score A])
Regards,
Andris
Hey,
I'm not sure what the result is that you'd like to get, but with the following formula, you can get blank values :
Score A = if('Key Measures'[Score A]=0;BLANK();'Key Measures'[Score A])
Regards,
Andris
OK, I knew that it was going to be simple, but so simple...
Thank you very much, Andris.
Hi @Anonymous
See this post before, same thing. Should work in your scenario
Yes, I checked that post already, but that is not my case. That guy needs to count something.
But I need just to insert null (I need empty cell).
User | Count |
---|---|
123 | |
76 | |
63 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |