Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
Hello Janey - Yes, I am using DQ mode as data volume is pretty high and Import option will not work for me. But "Measure Name" is not a calculated column in power BI. In fact, this column directly comes from underneath tabular model itself.
@nilimarodrigues Were you able to resolve this issue?
I created a Dataset DCOO for table DCOO field DCOO. Created a parameter in the model from it called DCOO. Automatically created a report parameter DCOO.
Attempted to create a Dataset called Contracts with the parameter: DEFINED the VAR for the query and set the parameter DCOO for DCOO on level DCOO for ALL. Getting the same NOT DECLARED message.
I have also tried setting the parameter on the Dataset Properties page of the Contracts Dataset after changing the VAR back to a constant (query runs fine) and then trying to change it back to parameter (Not Declared)
Hi, @nilimarodrigues
According to your later description, your code seems to be no problem, it's so strange. I'm sorry not to help you to solve it.
Do you mean [measure name] is a column? If it is a column created in the model, it is not a real column.
Best Regards
Janey Guo
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.
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.
Hi v-janeyg-msft
Sorry for the late reply but measure name is not a "Measure" its a column. Its a characteristic field. It has values like KPI1, KPI2 etc.
I am not using TREATAS on a measure.
Thanks,
Nilima
Hi, @nilimarodrigues
You need to modify the first line of code and make it comply with the rules of use of the TREATAS. It doesn't seem to support parameters.
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.
Please refer to below youtube video (At 12:00 Min in video) from "Guy in cube" wherein he did use parameter for TREATAS.
https://www.youtube.com/watch?v=KYfhclGrI48&t=892s
Are you suggesting that TREATAS function was supporting parameters up until one point of time and just not able to support it now?
Hi, @nilimarodrigues
You said you use DQ mode and 'DimMeasures'[Measure Name] should be a calculated column, so I think this is a conflict.
Can you change it to import or turn the calculated column into a column then try it?
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |