Forum Discussion
Replace column values by condition
Hello,
How I could replace column values by specific condition. For example, I am concatenating company name and journal code.
I know that some companies journal codes contains $ character some not. I want replace concatenated column values $ if it contains company name "cname" etc.
Hi Analitika ,
Pls test the below:
newvalue = IF(FIND("cname",'Table'[value],1,BLANK())<>BLANK(),"&"&""&'Table'[value],'Table'[value])Then delete the before column and rename new column:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
4 Replies
- amitchandak
Super User
Analitika , you can replace in power query .
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. - rohit_singh
Solution Sage
Hello Analitika ,
Please refer to the solution here :Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊 - Arul
Super User
check this
New column = If(OR(CONTAINS('Journal code','Journal code'[Journalcode],"$"),'Journal code'[Companyname]="Cname"), CONCATENATE('Journal code'[Companyname], SUBSTITUTE('Journal code'[Journalcode],"$","")), CONCATENATE('Journal code'[Companyname],'Journal code'[Journalcode]))Thanks,
Arul
- v-luwang-msft
Community Support
Hi Analitika ,
Pls test the below:
newvalue = IF(FIND("cname",'Table'[value],1,BLANK())<>BLANK(),"&"&""&'Table'[value],'Table'[value])Then delete the before column and rename new column:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien