Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
awtahhan
Regular Visitor

Replace column values using Uri.parts function

Hello,

 

I have a column with encoded URL values, I want to decode and replace these values using Uri.parts function, to do so I constructed the following poqwer query:

 

Table.ReplaceValue(#"Renamed Columns3", each [url], Uri.Parts(Table.Column(#"Renamed Columns3","url"))[Query][a], Replacer.ReplaceValue, {"url"})

 

But I am getting the following error:

 

Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=[List]
Type=[Type]

Could any one please help me with this problem?

Thanks in advance.

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @awtahhan 

 

Download example PBIX file

 

The initial error you posted stated We cannot convert a value of type List to type Text. so I expected that your url column contains Lists somewhere like this

lsts.png

 

To avoid that error you can use try..otherwise when creating your Custom Column in Power Query like this

try Uri.Parts("http://contoso?a=" & [url])[Query][a] otherwise [url]

which gives this result

lsts2.png

 

Check my file above for the full code example.

Regards

Phil

    



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

3 REPLIES 3
PhilipTreacy
Super User
Super User

Hi @awtahhan 

 

Download example PBIX file

 

The initial error you posted stated We cannot convert a value of type List to type Text. so I expected that your url column contains Lists somewhere like this

lsts.png

 

To avoid that error you can use try..otherwise when creating your Custom Column in Power Query like this

try Uri.Parts("http://contoso?a=" & [url])[Query][a] otherwise [url]

which gives this result

lsts2.png

 

Check my file above for the full code example.

Regards

Phil

    



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

Hi @awtahhan 

The column you're trying to decode contains Lists.  Can you please supply some sample data to help me see what youu are working with.  I need to know what is in those Lists.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

 

Thanks for your reply, please find below screenshot. The column does not hold full URL, it is only holding the encoded query parameter values. I want to decode those query parameter values.

 

awtahhan_1-1616911796445.png

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.