Forum Discussion
current value
- Anonymous9 years ago
Hi ksax
I usually enter the value I want to use for my query in the current value.
- 9 years ago
Hi ksax,
The Current Value setting allows users to specify the value for the parameter in the current report.
It should be noted that if the Required check box is enabled, this field must be filled in. Otherwise the Current Value is optional. This item is very much like the default value for a parameter in SSRS. You may also want to note that currently only a single value is allowed. For more details about using Parameters in Power BI, you can refer to this article. :smileyhappy:
Regards
What if you want the param to have a value from a query rather than a literal value? For example, I have a query that returns a list with one value (a date). I want my parameter to have that value, but instead it's only passing "Current Value" to the query (which is no more useful than hardcoding some value into the query).
I'm trying to do something similar. I'd like "Current Calue" to be Now() so that it suggests today's date as the default vlaue for the parameter. Is there a way to do this?
- Anonymous4 years agoNot applicable
To fix sepcifically your requirement to pass "TODAY's DATE" into the PowerQuery statement, you can use "DateTime.FixedLocalNow()". You will need to do this in the Advanced Editor I think. You might need to format the DateTime result to a Date format or even Text depending on the requirement of the database, keep that in mind.
Note: you can now also change this to a Relative date in the past using AddDates.
Example: {DateTime.Date(Date.AddDays(DateTime.FixedLocalNow(),-90))