Forum Discussion

nisha_deepak's avatar
nisha_deepak
Helper III
5 years ago
Solved

checking value is blank

i want to check every column of my report for whether that column conatins value or not,,,if blank means i want add a default value intead of it...IF the column contain blank is type ( number...put 0, decimal number means 0.00, text type means put "0").How can i do that?i have almost 100 column in my report

  • nisha_deepak , In power bi isblank can be used to check blank in DAX and null in power query

    New column like

    if(isblank[col1]),0,[col1])

    or

    if(isblank[col1]),0.0,[col1])

     

    Power Query

    if [col1] = null then 0 else [col1]

     

    refer: excel-inside.pro/blog/2018/05/17/comparing-null-values-in-power-query/

4 Replies

  • nisha_deepak , In power bi isblank can be used to check blank in DAX and null in power query

    New column like

    if(isblank[col1]),0,[col1])

    or

    if(isblank[col1]),0.0,[col1])

     

    Power Query

    if [col1] = null then 0 else [col1]

     

    refer: excel-inside.pro/blog/2018/05/17/comparing-null-values-in-power-query/

    • nisha_deepak's avatar
      nisha_deepak
      Helper III

      i got integer value as o for the blank column.But for decimal number having blank value i can't apply value as 0.00.

      i try this...

                 

      if(ISBLANK([column1]),0.00,[column1])
       i am getting o only not 0.00.
       
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi nisha_deepak ,

        Firstly, it can't exist multiple data types in the same field. What's the data type of field [column1]? How did you set the data type of new calculated column with formula if(ISBLANK([column1]),0.00,[column1])? If the data type of [column1] is numeric type, you can set the data type for your calculated column as below screenshot:

        Best Regards