Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
gduobaite
Helper III
Helper III

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 9
Pragati11
Super User
Super User

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.

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

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Dear @Pragati11

 

I have 7k unique values in Column1.

I don't want to replace anything in my new column, just add a filter from other column and get a new column with filtered values. 

 

 

Copy all values from Column1 into my new column with added filter (or condition, I don't know) where Event name = "result clicked" and thats how get a whole new column with filtered values which are only result clicked. 

 

Hi @gduobaite ,

 

Is the requirement on getting this new column is in your source data?

 

If not then just drag COLUMN1 to a table visual --> Create a slicer on COLUMN1 --> select values in slicer -- Table visual will get updated based on slicer selection.

 

If this is not the case then please add more detail with th example as your 1st example is not clear enough to answer your query.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 , I need a new column with filter in the formula inside, that in the future I could add several columns like that but with different filters into my table visual. Otherwhise, If I'm using one filter (slicer) to whole table visual, it affects all columns. But I don't need that. 

hi @gduobaite 

I'm a little confused by your description, could you please share your sample pbix file and your expected output, that will be a great help.

Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

If this is your requirement, as @Pragati11 said, only solution is to add new columns to your table like:

Column2 = IF('Table1'[Column1] = "A", 'Item'[Column1], " ")

Column3 = IF('Table1'[Column1] = "B", 'Item'[Column1], " ")

@gduobaite 

It sounds strange that you should need to add (more) filtered columns to a table (in the future?).

Perhaps if you show a mock up of what you need to do and why (the model, fact/dimension tables and final visual) we can help with a more practical solution.

A sample dataset or PBIX file would be great.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.