Forum Discussion
Report Builder Parameter Formatting (Datetime to Date)
- 3 years ago
sevenhills
I want to sincerely thank you again for your assistance with this. Ultimately it took more steps to resolve but you helped set me on the right path. Turns out it isn't that hard, but for someone who is used to PBI Desktop and brand new to paginated reports it was a painful learning process.
Here is the solution for anyone who may benefit from this in the future.
1. For the original error "The expression references the parameter 'DateParam', which does not exist in the Parameter collection", I realized that my data source query, which is a DAX query pointed at a Power BI dataset, was not correctly pointing at the "@DateParam". So I added that reference to the DAX query (which you can get from the Performance Analyzer in PBI Desktop).
// DAX Query
DEFINE
VAR __DS0FilterTable =
FILTER(
KEEPFILTERS(VALUES('Date_Dimension'[last_day_in_month])),
'Date_Dimension'[last_day_in_month] = @DateParam
)
2. Next, I created a seperate dataset for just the date parameter and added a calculated column that takes a substring of the full datetime text that is output by default.
=LEFT(Fields!DateParam.Value, 10)
3. Then under the DateParam-->Available Values, I made that calculated field the label field. That finally results in the correct format.
Few things to consider fixing given your post,
a) Rename the dataset parameter name from "Date".
Reason: Date is typically a reserved word.
b) If you are using SQL server, the dataset parameter dialog shows as like this
But yours show without "@".
Paginated reports are nothing but SSRS reports, FYI.
C) If above steps did not help, remove the parameter related code ONLY in the dataset and try to run the report.
Say, hard coded value for the parameter name and see the report renders.
My suspect is that you are using the reserved word (or) Parameter Name missing "@".
Hope it helps resolving or isolating the root cause!