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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ValeriaBreve
Post Partisan
Post Partisan

Pass a function name as parameter in Query Editor

Hello,

I have a report where I need to change quickly the data source from Onedrive to the server for several queries.

I use a parameter to indicate the path, but then I also need to change the function (Web.Contents to File.Contents and viceversa).

I have tried to set it as a parameter (File_Type being either Web.Contents or File.Contents), but PowerBI does not let me do that:

Expression.Error: We cannot convert the value "Web.Contents" to type Function.
Details:
Value=Web.Contents
Type=[Type]

 

Is there another way to do this?

Thanks!

Kind regards

Valeria

 

 

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @ValeriaBreve ;

You can check if these related post can is useful to you.

https://community.powerbi.com/t5/Desktop/Expression-Error-We-cannot-convert-the-value-x-to-type-Text...

https://stackoverflow.com/questions/36212091/power-bi-query-to-web-service-error-expression-error-we...


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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.