Forum Discussion

gduobaite's avatar
gduobaite
Helper III
5 years ago

Add new column

Hi, 

 

how can I create a whole new copied column in the same table with added filters inside?

 

I have:

 

Column1
A
B
B
C

 

I need a new column with only B values:

 

New Column
blank
B
B
blank

 

I tried with ADDCOLUMN, but it requires a new table.. Or I understood not correctly.

9 Replies

  • Hi gduobaite ,

     

    You can just use a DAX expression to create a new column:

    NewColumn = IF(tablename[Column1] = "B", "B", " ")

     

    Replace tablename in above DAX with your table name.

     

    Thanks,

    Pragati

    • gduobaite's avatar
      gduobaite
      Helper III

      Hi, Pragati11 , 

       

      you see, I have many values in my column, over 15k rows, so it's impossible to use IF function and type each row by row. 😞

      I need a copied column with filters inside.

      • Pragati11's avatar
        Pragati11
        Super User

        Hi gduobaite ,

         

        How many unique values do you have in this COLUMN1 in your real data-set?

        From these unique values, how many of them you want to replace in NewColumn?

         

        Thanks,

        Pragati