Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    2 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-Heide's avatar
    Jon-Heide
    Microsoft Employee

    You could try setting the value of the parameter to an expression. Something like: 

    =DateTime.Now().AddDays(-30)

  • Anonymous's avatar
    Anonymous
    Not 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.

  • Did you find a solution to this? I currently need the same for my paginated report. 

    • Anonymous's avatar
      Anonymous
      Not 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 ๐Ÿ˜‰

      • rachaelwalker's avatar
        rachaelwalker
        Resolver 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