Bird
0
0

You want to create a calculated column that converts a Text column 'Flag' with values 'True' and 'False' to Boolean type in DAX. Which expression is correct?

hard📝 Scenario Q9 of 15
Power BI - Power Query Editor
You want to create a calculated column that converts a Text column 'Flag' with values 'True' and 'False' to Boolean type in DAX. Which expression is correct?
AFlagBoolean = VALUE(Table[Flag])
BFlagBoolean = IF(Table[Flag] = "True", TRUE(), FALSE())
CFlagBoolean = CONVERT(Table[Flag], BOOLEAN)
DFlagBoolean = Table[Flag] * 1
Step-by-Step Solution
Solution:
  1. Step 1: Understand Boolean conversion in DAX

    DAX does not have direct type conversion from text to Boolean; use IF to map text to TRUE/FALSE.
  2. Step 2: Evaluate each option

    FlagBoolean = IF(Table[Flag] = "True", TRUE(), FALSE()) uses IF to return TRUE() or FALSE() based on text comparison, which is correct.
  3. Final Answer:

    FlagBoolean = IF(Table[Flag] = "True", TRUE(), FALSE()) -> Option B
  4. Quick Check:

    Use IF to convert text to Boolean in DAX [OK]
Quick Trick: Use IF to map text 'True'/'False' to Boolean [OK]
Common Mistakes:
  • Using VALUE on text 'True'/'False' causes error
  • Assuming CONVERT supports Boolean
  • Multiplying text by 1 causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Power BI Quizzes