cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Passing a parameter to query: We cannot convert a value of type Table to type Function.

Hello!

I want to have a parameter where I can use it on my measures (What If scenario is not applicable because it only accepts 4 digits), and I stumbled upon: Solved: Passing Parameters in measures - Microsoft Power BI Community

 

So I made my parameter and used it as a source for table query but it has the following error (I'm very new to Power Query and I do admit that I don't understand it much that's why I'm relying to samples on the web):

 

Here's my parameter:

crln-blue_0-1608608030785.png

 

Type: Any Value

 

Here's my query:

crln-blue_1-1608608060523.png

 

 

let
    Source = data({"End Cash"},{{Param1}})
in
    Source

 

 

Error:

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

 

Any tips? My parameter is inside my soure table "data". Thanks!

1 ACCEPTED SOLUTION
Super User III
Super User III

Hi @crln-blue 

When you use the table name data and then follow it with () PQ thinks you're calling a function.  As data is a table, you get the error you are seeing.

What exactly are you trying to do?

It looks like you are trying to pass the string "End Cash" and the parameter into your data table for something.  If you want to use the value for Param1 inside another query you can use its name.

Perhaps you can provide a screenshot of what your data table looks like and explain what you want to do with the string "End Cash" and the parameter.

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

4 REPLIES 4
Super User III
Super User III

@crln-blue 

Great, glad I was able to help.

Regards

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



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!


Helper V
Helper V

Hello again @PhilipTreacy !

 

I tried your suggestion and it worked! I simply places it in the let in the source. I was able to convert it into a table using the Convert To Table function. Thanks!

crln-blue_0-1608617778301.png

 

Super User III
Super User III

Hi @crln-blue 

When you use the table name data and then follow it with () PQ thinks you're calling a function.  As data is a table, you get the error you are seeing.

What exactly are you trying to do?

It looks like you are trying to pass the string "End Cash" and the parameter into your data table for something.  If you want to use the value for Param1 inside another query you can use its name.

Perhaps you can provide a screenshot of what your data table looks like and explain what you want to do with the string "End Cash" and the parameter.

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

Hello @PhilipTreacy ! Thanks for the reply!

I want to use the parameter on my calculated measure. I saw somewhere that to be able to use it, I can pass it to a table. What If scenario won't work for me because I noticed that it only accepts up to 4 digits. 

 

My data table is like this but has more columns. No computation on the data table since my computations are on a different table (summarized dax table):

crln-blue_0-1608616432350.png

 

 

So how do I use my parameter on a calculated measure? Thanks!

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors