Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I am trying to replace whole text with "Yes" in case it contains "Product"
Currently, I create a new conditional column, than I remove column, but I would like to do it in one step and simply replace the text.
Current code:
#"Added Conditional Column" = Table.AddColumn(#"Filtered Rows1", "Project", each if Text.Contains([#"Product Based Project"], "Product") then "Yes" else "No")
Thanks in advance.
Alex
(Mr. Amit please don't spam this post.)
Solved! Go to Solution.
Hi @adelmonte ,
In this case you need to use the approach on the video below:
I have made a sample file with the formula that should be something similar to the one below:
= Table.ReplaceValue(#"Added Custom", each [Category], each if Text.Contains( _[Category], "Product") then "Yes" else [Category] ,Replacer.ReplaceText,{"Category"})
Has you can see the custom column (used for comparision only) give the same result has the one with the ReplaceValue. I also did not replace the full text by "No" to give the comparision between the values but if you change the values by:
= Table.ReplaceValue(#"Added Custom", each [Category], each if Text.Contains( _[Category], "Product") then "Yes" else "No" ,Replacer.ReplaceText,{"Category"})
Then result is has below:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @adelmonte ,
In this case you need to use the approach on the video below:
I have made a sample file with the formula that should be something similar to the one below:
= Table.ReplaceValue(#"Added Custom", each [Category], each if Text.Contains( _[Category], "Product") then "Yes" else [Category] ,Replacer.ReplaceText,{"Category"})
Has you can see the custom column (used for comparision only) give the same result has the one with the ReplaceValue. I also did not replace the full text by "No" to give the comparision between the values but if you change the values by:
= Table.ReplaceValue(#"Added Custom", each [Category], each if Text.Contains( _[Category], "Product") then "Yes" else "No" ,Replacer.ReplaceText,{"Category"})
Then result is has below:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMuchas gracias Miguel!
Thank you so much!
Best regards,
Alex
User | Count |
---|---|
11 | |
8 | |
5 | |
5 | |
4 |
User | Count |
---|---|
16 | |
14 | |
8 | |
6 | |
6 |