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.
Hello,
I have a data with many missing values for variable X and I'd like to do a simple transformation of this variable such as adding 3 to all values.
I tried the formula below:
X_new = if('Data'[X] = BLANK (); BLANK(); 'Data)'[X] + 3)
And it works almost perfectly (returns BLANK for those rows which have missing value) but the problem is that now also the rows with value = 0 are treated as BLANK. So, in the end, I have more missing values for variable X_new than for original variable X.
I'd appreciate suggestion how to deal with this problem.
Gabriela
Solved! Go to Solution.
Hi @gabriela
USe this instead
X_New = IF ( NOT ( ISBLANK ( Data[X] ) ), Data[X] + 3 )
Hi @gabriela
USe this instead
X_New = IF ( NOT ( ISBLANK ( Data[X] ) ), Data[X] + 3 )
Thank you @Zubair_Muhammad for such a quick reply. It worked perfectly!
The follow-up question: do you know why 0 were treated as missing values (BLANK) with my formula? I'm trying to understand the syntax of DAX.
Thanks,
Gabriela
Hi @gabriela
The problem comes from the "=" OPERATOR
In DAX terms
BLANK() = 0 = true
but
ISBLANK(0)= FALSE
So formulas below give different results
=if('Data'[X] = BLANK (), BLANK(), 'Data'[X] + 3)
=if(ISBLANK('Data'[X]) , BLANK(), 'Data'[X] + 3)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
85 | |
65 | |
51 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |