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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Expression.Error: We cannot convert a value of type Record to type Text.

iam trying to do dynamic M query parameter.

iam using odbc to amazon athena datsource in power desktop.

first iam loading the table by wring the sql query in while importing.

for passing values in parameter , i have  slected one column and added as new query.

Then i created parameter  and passed values from query selectday. the apped the parameterr in the query1.

after igot no syntax errors, but iam getting below error.

swathi1997_0-1657700922077.pngswathi1997_1-1657701064217.pngswathi1997_2-1657701130460.png

Kindly help me with the solution

7 REPLIES 7
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

The second argument of function Odbc.Query() should be a text than record, which i have highlight in red.

vchenwuzmsft_0-1658136445059.png

 

Replace it with:

Odbc.Query("dsn=CocobluData", filterquery)

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks @v-chenwuz-msft , i have done that now, the error is gone, but iam not getting data, it is blank, but actualy data is there. Please help me with these. why it it is getting blank, iam loading as import mode , data souce is aws athena, using odbc connectoe in power bi. 

swathi1997_0-1658140888959.png

 

Hi @Anonymous ,

 

Can you use SQL statement as text directly with Odbc.Query() to check wether it is right.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try MM in capital case .

 

In power query, few of them work with a capital case

Anonymous
Not applicable

@amitchandak ,Thanks for the reply.

if iam test parameter also iam getting following error

swathi1997_0-1657707965039.pngswathi1997_1-1657708061703.png

Kindly help me for the solution

 

 

@Anonymous , But, we discussed about the date in the first update.

 

for this one can check the type of the parameter, it should be text

Anonymous
Not applicable

@amitchandak , Thanks for the quick reply,

First one about date is still loading. we have another where have parameter with text.

swathi1997_0-1657708507794.png

we are text type in parameter. but still getting same error.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.