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 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