Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Automatic Slicer

Hello,   I have a report which adds in a months data through SQL agent at the end of each month.   This populates the slicer like in the image.   As currently, I have to get the report from the...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Managed to get around this by putting a case statement into my SQL view that would show the previous months data.

     

    case when LEFT(CONVERT(varchar,DATEADD(MONTH,-1,GETDATE()),112),6) = SnapshotPeriod then 1 else 0 end as IsCurrentMth.

     

    I then merged the 1 from IsCurrentMth with the standard SnapshotPeriod to get my new slicer.