Forum Discussion
Using a relative date as a parameter in Paginated reports
I need to schedule exports of reports in excel/csv to external vendors and partners. These reports are sent at the beginning of each monthly with the prior monthโs data as an excel sheet attachment to me.
I am using the Paginated Report feature along with the Subscription Service of Power BI Services. Currently, I am manually inserting the dates. Does anyone know a way I could set up these Paginated reports with a relative date as the parameter, say previous month; so they run automatically? This feature was available when I created similar output in Reporting Services 2012.
- Anonymous2 years ago
My solution was to create another column called Prior Month and then populate it with the Power Query function of =Date.IsInPreviousMonth([DATE FIELD]). I then use a filter/parameter where that column = Y. Not the path I thought, but it works...for now ๐
5 Replies
- Jon-HeideMicrosoft Employee
You could try setting the value of the parameter to an expression. Something like:
=DateTime.Now().AddDays(-30)
- AnonymousNot applicable
Thanks for the suggestion. That was one of my original "tries" - but it only will work if the previous month is 30 days and if I run it on the 1st of the next month ๐ฏ. I am looking for something that behaves like the Slicer Month (Calendar), but I will also look at the Expressions in Paginator that you mentioned - appreciate the advice.
- rachaelwalkerResolver III
Did you find a solution to this? I currently need the same for my paginated report.
- AnonymousNot applicable
My solution was to create another column called Prior Month and then populate it with the Power Query function of =Date.IsInPreviousMonth([DATE FIELD]). I then use a filter/parameter where that column = Y. Not the path I thought, but it works...for now ๐
- rachaelwalkerResolver III
That is the path I took too. I created flags for each scenario (previous month, ytd, ftyd) then combined those values into one column (YTD | FTYD). From there I created a parameter that specifies the values Previous Month, YTD, FTYD. Then added a parameter/filter that says to filter data based on if Parameter value is found in my combined column. ๐ Lots of trial and error but I think it is working