Forum Discussion
Default to Current Month & year
Hi there,
Is it possible to default the current month and year on the page if I have just the year and month as a slicer? Please advise
Thank you!!
Hi sraj
Do you mean you'd like to set default value in slicer? Actually, It's not possible to set dafault values to slicers.
But you might refer to some workaround for hints:
https://community.powerbi.com/t5/Desktop/Default-value-set-in-Slicer/m-p/1237899#M559289
Or raise an idea:
https://ideas.powerbi.com/ideas/idea/?ideaid=0eab4ba7-b039-4785-9414-b8c94ab06e25
5 Replies
- amitchandak
Super User
sraj , You need have this column in you date table and use that on your page
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)Sort on month year sort
Format([Date],"YYYYMM")
- sraj
Responsive Resident
Hi amitchandak - I am getting this error message.
The syntax for 'Sort' is incorrect. (DAX(Switch( True(),eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,eomonth([Date],0)= eomonth(Today(),0),"This Month" ,Format([Date],"MMM-YYYY")) Sort on month year sortFormat([Date],"YYYYMM"))).
- amitchandak
Super User
sraj ,
Column 1 --------------
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)Column 2 --------------------
Month Year Sort = Format([Date],"YYYYMM")
How to sort - https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- sraj
Responsive Resident
I was able to get these two columns on the report, but how do I put that on the page...I am not clear on what to do after adding these two columns. PLease help!!
- v-diye-msft
Community Support
Hi sraj
Do you mean you'd like to set default value in slicer? Actually, It's not possible to set dafault values to slicers.
But you might refer to some workaround for hints:
https://community.powerbi.com/t5/Desktop/Default-value-set-in-Slicer/m-p/1237899#M559289
Or raise an idea:
https://ideas.powerbi.com/ideas/idea/?ideaid=0eab4ba7-b039-4785-9414-b8c94ab06e25