Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a report that I has a date parameter. I want to default it to today's date with the option for the user to change it to any date after it renders today's info. I can hard code a date like so:
rp:courtstartdate=2021-03-16
How can I pass today's date to the parameter in the URL?
Solved! Go to Solution.
Could you set a default value expression of =Today() in the parameter?
Hi, @alexleyva
The definition of the parameter can't use the dax function such as today(). You can manually enter today's date every day, or add a istoday column to the data source,Like istoday =IF ( table[date] = TODAY (), 1, 0 ), and then write the parameter like this: &rp:istoday=1.
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.
I do have a default value expresion that gets set when I manually select a value for another parameter. If I try to add both parameters to the URL, I can only hardcode the date. Will not allow me to add something like "Today()" Here is an URL that works:
https://app.powerbigov.us/groups/{Blah}/rdlreports/{Blah} &rp:courthouse=-2&rp:courtcode=BUR%20&rp:courtcode=NCA%20&rp:courtstartdate=2021-03-16
This one does not work:
https://app.powerbigov.us/groups/{Blah}/rdlreports/{Blah} &rp:courthouse=-2&rp:courtcode=BUR%20
or
https://app.powerbigov.us/groups/{Blah}/rdlreports/{Blah} &rp:courthouse=-2&rp:courtcode=BUR%20&rp:courtstartdate=Today()
Why are you trying to send it in the URL rather then doing it in the report design?
The user must select a courthouse, then up to 20 departments to see the report. This can be anoying for someone that must do this every day. If I show them how to create a link with the parameters preset, they will be more inclined to accept this new concept.
If the majority of the time they are going to want todays date. Then my original idea is still valid. You can 'hard code' the date parameter to be =Today() in the report. Then if they want something different, they add that parameter to the url string. So you are making it easy for the majority of the requests and still have an option for the rest.
Could you set a default value expression of =Today() in the parameter?
I did. But this parameter was the last parameter. Once I changed it to be the first parameter it worked, and I did not have to included it in the URL. I just had to include the other two parameters.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
4 | |
4 | |
3 | |
3 |
User | Count |
---|---|
14 | |
9 | |
6 | |
3 | |
3 |