Power Query not keeping a space in a list

macfuller

Active Member
Joined
Apr 30, 2014
Messages
317
Office Version
  1. 365
Platform
  1. Windows
The ever-awesome PowerPivotPro gurus posted a thread on how to do a CONTAINS search from a measure selection. The list to use in the slicer is generated by a query as shown in a simplified sample below.

The problem is that PowerQuery appears to eliminate spaces from the list in this query leading to the equivalent of wildcard searches. As an example at our research facility we use mice and rats and I would like to pull all values where "rat" is present in a description, but not "aspirator" or "rating". Is there a parameter I can set where PowerQuery will preserve the spaces?
let
SourceList = {"Angiocath",
"Catheter",
"Electrode",
"Rat ",
"Stent",
"Suture",
"Syringe",
"Wire"},
StartList = Table.FromList(SourceList,Splitter.SplitByNothing(),{"Keyword"}),
ChangeToText = Table.TransformColumnTypes(StartList,{{"Keyword", type text}}),
AddIndex = Table.AddIndexColumn(ChangeToText, "Keyword Index", 1, 1),
ChangeToInteger = Table.TransformColumnTypes(AddIndex,{{"Keyword Index", Int64.Type}})
in
ChangeToInteger
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top