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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tksnota
Post Patron
Post Patron

Question on Replace Function

Hi,

 

I add a new column by copying an existing one and changing the format from numbers to text (copied year column and division new one) then add my text as shown so that i can create a relationship with another sheet.

 

I'm wondering if I refresh the original source data and new rows are introduced...will power bi automatically add the text that i entered in the new column.

 

//NT

 

tksnota_0-1720079291357.png

 

1 ACCEPTED SOLUTION

@tksnota Put comma inside a double quotation and use & like below:

Date.ToText([Invoice Date]) & " , " & [Comments]

Hope this answered your question. If, please mark it as a solution!!



View solution in original post

14 REPLIES 14
tksnota
Post Patron
Post Patron

my requirement is establish a relation with another sheet so by adding a new column without using custom just by copying any existing one and changing the field from number to text

 

the above requirement is satisfied. but my question since i haven't used custom column only copy an existing one and made the changes...will the new column automatically introduced the changes i maded in this case a text after a refresh and numerous rows are created

 

hope i make myself clear

Select the column you want to copy.
Right-click on the column header and select Duplicate Column. This will create a new column with the same values as the original.

Select OrderID_Text.
Go to the Transform tab.
Click on Data Type and select Text

 

When steps are recorded in Query editor than new data will also be updated you can follow this method




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






thanks. I had done this exercise already...

bhanu_gautam
Super User
Super User

Can you explain what is your exact requirement as compared to your original column

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






tksnota
Post Patron
Post Patron

Hi,

 

 

 Will the column add the text when new rows are introduced after refresh because I got conflicting answer?

 

I attempted to use Custom Column but I don't know how to do it. Can someone share me the syntax i need to use?

@tksnota Please find the image below to create custom column. If your column is integer data type, then you need to convert it to text first to add custom text, otherwise it will throw error.

Number.ToText() function helps to convert numbert to text and '&' is used as concat text.

shafiz_p_0-1720084887539.png

 

If this solves your problem, mark it as solution.

Hi,

 

Your code is great. Is it possible to capture the Text without the year as shown?

 

//NT

 

tksnota_0-1720085639844.png

tksnota_1-1720085655656.png

 

 

@tksnota Based on my understanding, you’d like to concatenate the ‘Division’ column with the ‘Year’ column and change the data type to text.

 

To achieve this, simply replace the hardcoded value ‘IND’ with the actual column name ‘[Division]’ and update the data type accordingly.”

 

Feel free to ask if you need further clarification or assistance!

 

If this answered your question, please mark it as solution!!

Thanks. Is it possible to do the following

 

1. concatenate Division with Invoice amount (Relationship 01)

1. concatenate Invoice Date  with comments (Relationship 02)

@tksnota Yes it is possible.

 

1. Division with invoice amount - [Division] & Number.ToText([Invoice amount])
2. Invoice Date with comments - Date.ToText([Invoice Date]) & [Comments]

Hope this answered you question. If, please mark it as a solution!!

this is great...how can i add comma to distinguish between the 2 data

@tksnota Put comma inside a double quotation and use & like below:

Date.ToText([Invoice Date]) & " , " & [Comments]

Hope this answered your question. If, please mark it as a solution!!



shafiz_p
Super User
Super User

@tksnota As I can understand, that you want to create a key column to develop relationship with other tables. Yes, If you create a column based on other columns, as you mentioned, and add specific text, after refresh, the new column will automatically update whenever new data is added to the source file.

If this answered you question, please mark it as solution.

bhanu_gautam
Super User
Super User

@tksnota , In Power BI, when you create a new column by copying an existing one and then manually add text to it, the new column will not automatically update with the text you entered if new rows are introduced upon refreshing the original source data. This is because the manual text entries are not part of the data transformation logic and are not dynamically applied to new data.

 

To handle this you can use Custom column and try to all modifications on the basis of that




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors