Forum Discussion
Automatic Slicer
- Anonymous6 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.
Hi , Anonymous
According to your current description ,you can try to create a calculated table and create a column like followings:
Table 2 = CALENDAR(DATE(2019,07,01),TODAY())Column 2 = IF(FORMAT([Date],"YYYY MM")=FORMAT(TODAY(),"YYYY MM"),"Current Month",FORMAT([Date],"YYYY MM"))Here is sample :
(This month is January, then in the next month, “2020 1” will be added in the slicer, and the current month will point to ”2020 02”)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous6 years agoNot applicable
Hi,
Thanks for the reply. Could I ask which part tells the slicer to default to stay on current month?
Thanks in advance
Liam
- Anonymous6 years agoNot applicable
Thanks for the reply
Could I ask which part tells the slicer to default to stay on current month?
- Anonymous6 years agoNot applicable
Hi v-easonf-msft ,
If the slicer date E.G. 201912 was coming from a column in a SQL view, would there be an alternative way to make it default to current month in the slicer?
Thanks
Liam
- Anonymous6 years agoNot applicable
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.