Forum Discussion
Current month default selection in Slicers
I have slicer with showing Month name.How i can set current month name as default value while loading report?
Currently i created a column like this for default set up...
- Anonymous5 years ago
Hi Anonymous ,
According to my understanding, you want to display the specific month based on the selected value in slicer,right?
You coulf create a table by entering data for slicer like this:
And then use SWITCH() function :
Current Month = IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) && MAX ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 )Previous Month = IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) && MAX ( 'Table'[Month] ) = MONTH ( TODAY () ) - 1, 1, 0 )....
= SWITCH ( MAX ( 'ForSlicer'[Value] ), "Current Month", [Current Month], "Previous Month", [Previous Month], "Next Month", [Next Month] )After applying the [Measure] to filter pane ,and setting as "=1", the final output is shown below:
Please take a look at the pbix file here.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- jdbuchanan71
Super User
Anonymous
Just change your calculated column a bit like so.
Current Month = IF ( YEAR ( 'table'[date] ) = YEAR ( TODAY () ) && MONTH ( 'table'[date] ) = MONTH ( TODAY () ), "Current Month", FORMAT ( 'table'[date], "mmmm" ) )This will give you a column you can use in your slicer where you can selecte "Current Month". As the months change and the table is refreshed the rows marked as "Current Month" will shift.
- AnonymousNot applicable
Hi Anonymous ,
According to my understanding, you want to display the specific month based on the selected value in slicer,right?
You coulf create a table by entering data for slicer like this:
And then use SWITCH() function :
Current Month = IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) && MAX ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 )Previous Month = IF ( YEAR ( MAX ( 'Table'[Date] ) ) = YEAR ( TODAY () ) && MAX ( 'Table'[Month] ) = MONTH ( TODAY () ) - 1, 1, 0 )....
= SWITCH ( MAX ( 'ForSlicer'[Value] ), "Current Month", [Current Month], "Previous Month", [Previous Month], "Next Month", [Next Month] )After applying the [Measure] to filter pane ,and setting as "=1", the final output is shown below:
Please take a look at the pbix file here.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.