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

The Query contains the "XXXX" parameter, which is not declared.

Hello,

 

I am trying to use "Paginated Report" on top of Power BI dataset. My dataset is a "Direct Query" connection on Azure datalake.

 

In order to create Paginated report with parameters, while creating dataset, I am using the query obtained through "Performance Analyzer" as shown below:

 

// Direct Query
Define

MEASURE 'FactVolume'[ASDQ_GRs] = [Gross Receipts]
MEASURE 'FactVolume'[ASDQ_CCAs] = [CCA]


var ASDQ___DS0FilterTable3 = TREATAS({@KPI}, 'DimMeasures'[Measure Name])
var ASDQ___DS0FilterTable4 = TREATAS({"Treatment"}, 'Product'[Level 4 A])
var ASDQ___DS0Core = SUMMARIZECOLUMNS(
'DimDate'[Date],
ASDQ___DS0FilterTable3,
ASDQ___DS0FilterTable4,
"GRs", [ASDQ_GRs]
)

EVALUATE
ASDQ___DS0Core

ORDER BY
'DimDate'[Date] DESC

 

I have created the parameter in "Query Parameters". In spite of declaring the parameter, I am constantly receiving below error:

"OLEDB or ODBC error: The Query contains the 'KPI' parameter, which is not declared.

 

What am I doing wrong? Do "Parameters" work with Power BI dataset connection which are of type "Direct Query"? 

 

Can you please help me to resolve this issue? Thank you so much.

 

@pabeader 

nilimarodrigues_0-1617856815110.pngnilimarodrigues_1-1617856823903.png

 

1 ACCEPTED SOLUTION

Hi, @nilimarodrigues 

 

I found that you used the 'treatas' function in the code expression. The following parameter must be one or more existing columns. It cannot be an expression. So it can't recognize KPI, not DQ problem. You need to convert measure to column.

v-janeyg-msft_0-1618193310161.png

Reference: TREATAS function - DAX | Microsoft Docs

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

View solution in original post

2 REPLIES 2
nilimarodrigues
Helper II
Helper II

Hello - Can some one please help with how can I proceed with resolving this issue?

 

Just to add - I just tried another dataset which have had "Import" connection and that worked fine. Is there a limitation on using parameters with direct connection?

Hi, @nilimarodrigues 

 

I found that you used the 'treatas' function in the code expression. The following parameter must be one or more existing columns. It cannot be an expression. So it can't recognize KPI, not DQ problem. You need to convert measure to column.

v-janeyg-msft_0-1618193310161.png

Reference: TREATAS function - DAX | Microsoft Docs

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

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.