Forum Discussion
Help with Custom date slicer values
- Anonymous5 years ago
Hi srk_powerbi ,
You could follow these steps:
1. Create a single table for Slicer like this:
2. Use the following formula after adding a Quarter column:Measure = VAR _sele = SELECTEDVALUE ( forSlicer[Type] ) RETURN SWITCH ( _sele, "ALL", 1, "Current Quarter", IF ( MAX ( 'Date'[Quarter] ) = QUARTER ( TODAY () ), 1, 0 ), "Last 2 Quarters", IF ( QUARTER ( TODAY () ) - MAX ( 'Date'[Quarter] ) >= 1, 1, 0 ), "Last Quarter", IF ( MAX ( 'Date'[Quarter] ) = QUARTER ( TODAY () ) - 1, 1, 0 ) )3. Apply the measure to filter pane (set as "=1") . My final output looks like this:
Please take a look at the pbix file here.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.Best Regards,
Eyelyn Qin
Hi srk_powerbi
You can add a column to your date table classifying the quarters:
| Current | 2020Q4 |
| Last | 2020Q3 |
| Last 2 | 2020Q3 |
| Last 2 |
2020Q2 |
| Other |
All the other quarters |
and use that column as slicer. The all option would just be no selection on the slicer
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
AlB thanks for replying.
But, how do we add two values
lest say for 2020Q4 it comes under 'Current Quarter' and 'Last 2 Quarters' ? we can assign one value to one row in calender table right?