Forum Discussion

shadowsong42's avatar
shadowsong42
Resolver I
1 year ago
Solved

Calculating a true/false column

I want to populate a calculated table column with TRUE or FALSE based on whether or not the ProductID is blank. I am using SELECTCOLUMNS() to get the other columns I need, and then trying to figure out how to populate this last column.

Can I just straight up use "NOT(ISBLANK('Stores ISP'[ProductID]))" as the expression for the column, or do I need to specify IF(expression,TRUE(),FALSE())?

  • Hi shadowsong42 Yes, you can directly use NOT(ISBLANK('Stores ISP'[ProductID])) as the expression for the calculated column in DAX. There's no need to use IF(expression, TRUE(), FALSE()) because the result of NOT(ISBLANK(...)) already evaluates to TRUE or FALSE. Dax would be something like this

    NewColumn = NOT(ISBLANK('Stores ISP'[ProductID]))

    If this post help[ed please do give a kudos and accept this as a solution
    Thanks In Advance

1 Reply

  • Hi shadowsong42 Yes, you can directly use NOT(ISBLANK('Stores ISP'[ProductID])) as the expression for the calculated column in DAX. There's no need to use IF(expression, TRUE(), FALSE()) because the result of NOT(ISBLANK(...)) already evaluates to TRUE or FALSE. Dax would be something like this

    NewColumn = NOT(ISBLANK('Stores ISP'[ProductID]))

    If this post help[ed please do give a kudos and accept this as a solution
    Thanks In Advance