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.
Using DataTimeformat function worked for me.