How to Fix Power Query Text and Number Concatenation Errors in Dynamic URLs
Question details
Users encounter an operator error in Power Query when attempting to concatenate numeric values with URL text strings to build dynamic web addresses.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Constructing dynamic URLs by appending dynamically generated numeric codes (such as company or quarter codes) to a base URL string.
- Observed behavior
- Power Query throws an operator error because it cannot automatically concatenate text strings with numeric data types using the ampersand (&) operator.
Verify the exact column names or list references containing your numeric codes before applying text conversion formulas.
Convert Individual Numeric Values Using Text.From
Apply the Text.From function to explicitly convert numeric query values into strings before concatenating them with your base URL.
Power Query requires strict data typing, meaning you cannot directly use the '&' operator to join text and numbers. You must explicitly convert numeric values into text formats so the software recognizes them as compatible strings for the URL.
Locate the exact variable or column reference containing your numeric codes, such as Source{0}[Column1].
Wrap the numeric reference in the Text.From() function to perform the conversion. For example, type: CompanyCode = Text.From(Source{0}[Column1]).
Construct the final URL by joining the newly created text variables with your base string using the '&' operator. For example: "https://www.bseindia.com/corporates/results.aspx?Code=" & CompanyCode.

Batch Convert Lists Using List.Transform
If your source contains an entire list or column of numbers, use List.Transform to convert all values to text simultaneously.
Manage Your Data Smoothly with WPS Office
If you frequently encounter complex data processing errors in Microsoft Office, try WPS Office. It provides a lightweight, highly compatible spreadsheet environment that handles data analysis efficiently without the heavy overhead.
- 1. Download the software: Visit the official WPS Office website and download the free installation package.
- 2. Install and launch: Follow the on-screen prompts to install the software, then open WPS Spreadsheet.
- 3. Import existing data: Open your standard Excel workbooks to effortlessly continue managing your text and numeric data.

Frequently Asked Questions
Why does Power Query show an operator error when using the '&' symbol?
Power Query uses strict data typing. The '&' operator can only concatenate text with text. Attempting to join a text string with numbers without explicit conversion triggers a type mismatch operator error.
Can I format dates to text for URL parameters in Power Query?
Yes, you can use the Date.ToText() or DateTime.ToText() functions to convert date values into properly formatted strings before appending them to your URL strings.
Does Power Query automatically convert data types like Excel formulas?
No, unlike standard Excel worksheet formulas, Power Query (M language) does not automatically convert numbers or dates into text during concatenation. Explicit conversion using functions like Text.From is always required.
What if my numeric codes lose leading zeros during conversion?
Ensure that the source column type is set to 'Text' before any transformations, or use the Text.PadStart() function alongside Text.From() to explicitly add leading zeros back into the final string.




