Reply
Highlighted
Frequent Visitor
Posts: 17
Registered: ‎09-20-2018
Accepted Solution

PowerBi Desktop => Unable to use wildcard character in Replace Values modal window

I'm unable to use wildcard characters when changing the values in a column.

Unable to add the screenshot from my local machine to describe the issue more properly (what does the Source text field mean in the pop up?). 

 

Steps to reproduce:

 

  1. Launch PowerBi Desktop (2.64.5285.741 64-bit (November 2018)
  2. Get you data (can be .csv or excel)
  3. Open Power Query Editor
  4. Click on Transform tab
  5. Click on Replace Values drop down
  6. Place  5/*/2018 *  into the Value To Find text field
  7. Place MAY-18 in Replace With text field
  8. Click on OK button
  9. Observe that no data change happens

 

Please advise if this is a bug or there is  a different syntax for using wildcards. 

 


Accepted Solutions
Moderator
Posts: 9,185
Registered: ‎03-06-2016

Re: PowerBi Desktop => Unable to use wildcard character in Replace Values modal window

Hi @aznariy,

 

You can write Power Query below: 

 

= Table.ReplaceValue(#"Changed Type",each [C1],each if Text.StartsWith([C1],"5/") and Text.EndsWith([C1],"/2018") then "MAY-18" else [C1],Replacer.ReplaceValue,{"C1"})

w4.PNG

 

You can refer to attached pbix file. 

 

Best Regards,
Qiuyun Yu 

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

View solution in original post

Attachment

All Replies
Moderator
Posts: 9,185
Registered: ‎03-06-2016

Re: PowerBi Desktop => Unable to use wildcard character in Replace Values modal window

Hi @aznariy,

 

You can write Power Query below: 

 

= Table.ReplaceValue(#"Changed Type",each [C1],each if Text.StartsWith([C1],"5/") and Text.EndsWith([C1],"/2018") then "MAY-18" else [C1],Replacer.ReplaceValue,{"C1"})

w4.PNG

 

You can refer to attached pbix file. 

 

Best Regards,
Qiuyun Yu 

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