Bird
0
0

Which of the following is the correct syntax to replace blank values with zero in a calculated column using DAX?

easy📝 Formula Fix Q12 of 15
Power BI - Data Cleaning with Power Query
Which of the following is the correct syntax to replace blank values with zero in a calculated column using DAX?
ANewColumn = ISBLANK([Sales]) ? 0 : [Sales]
BNewColumn = IF([Sales] = 0, BLANK(), [Sales])
CNewColumn = IF(ISBLANK([Sales]), 0, [Sales])
DNewColumn = REPLACE([Sales], BLANK(), 0)
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct DAX syntax for replacing blanks

    The IF function combined with ISBLANK checks if [Sales] is blank and replaces it with 0; otherwise, it keeps [Sales].
  2. Step 2: Evaluate other options for syntax errors

    NewColumn = IF([Sales] = 0, BLANK(), [Sales]) replaces zeros with blanks, not blanks with zero. NewColumn = ISBLANK([Sales]) ? 0 : [Sales] uses incorrect ternary syntax (not valid in DAX). NewColumn = REPLACE([Sales], BLANK(), 0) uses REPLACE incorrectly (not for blanks).
  3. Final Answer:

    NewColumn = IF(ISBLANK([Sales]), 0, [Sales]) -> Option C
  4. Quick Check:

    Use IF(ISBLANK()) to replace blanks = A [OK]
Quick Trick: Use IF(ISBLANK()) to replace blanks with values [OK]
Common Mistakes:
  • Using ternary syntax not supported in DAX
  • Confusing blank with zero
  • Using REPLACE function incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Power BI Quizzes