cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ajitkaur Frequent Visitor
Frequent Visitor

Update column value without creating new column

Hi Team,

 

I am new to Power BI and i would like to know the best possible solution for below condition:

I would like to update column value (data source is sharepoint custom list). For example, in SQL query I would do something like this:

 

update table1

set col1= "OOF"

where col2 = "Admin"

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
diogoblunck Regular Visitor
Regular Visitor

Re: Update column value without creating new column

Hello, @Ajitkaur 

Power Query

Enter in your query, click in the FX icon near the formula bar and insert this code:

 

= Table.ReplaceValue( #"PreviousStep" ,each [col1],each if Text.Contains([col2], "Admin") then "OOF" else [col1],Replacer.ReplaceValue,{"col1"})

 

Change the name of the step in red and you are ready to go.

 

 

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Update column value without creating new column

@Ajitkaur unfortunately you cannot update existing column but you can add new conditional column either using Power Query or DAX, if you use Power Query, you can rename the old one, add new one with the original name and then remove the old one, so one it is loaded in the model, you will see new column with original name with updated value. Hope it is helpful.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





diogoblunck Regular Visitor
Regular Visitor

Re: Update column value without creating new column

Hello, @Ajitkaur 

Power Query

Enter in your query, click in the FX icon near the formula bar and insert this code:

 

= Table.ReplaceValue( #"PreviousStep" ,each [col1],each if Text.Contains([col2], "Admin") then "OOF" else [col1],Replacer.ReplaceValue,{"col1"})

 

Change the name of the step in red and you are ready to go.

 

 

View solution in original post

CerbPBI Frequent Visitor
Frequent Visitor

Re: Update column value without creating new column

I'm looking to do the same. Any help is greatly appreciated.

Highlighted
Ajitkaur Frequent Visitor
Frequent Visitor

Re: Update column value without creating new column

Hi @diogoblunck

 

Thank you for the prompt reply.

 

This is exactly what I was looking for

 

 

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 48 members 991 guests
Please welcome our newest community members: