Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hanrft
Regular Visitor

Using overlapping date periods in a slicer

I am working with dates that belong to multiple 'star ratings' periods. 

These are the current upcoming periods, they follow the same logic ongoing: 

Mar25 QTR = 1 Jun 23 to 31 May 24

Jun25 QTR = 1 Sep 23 to 31 Aug 24

Sep QTR = 1 Dec 23 to 30 Nov 24

Dec QTR = 1 Mar 24 to 29 Feb 25

 

I would like to be able to create a slicer so that if someone selected 'Mar25 QTR' they would be able to see all dates applicable to that period, however I am stuck in that I can only assign one period to each date, however each date applies to 4 periods. Currently my work around is having a bookmark for each period, however that also means that I have to keep adding new bookmarks as needed.

 

Currently I have a custom column to identify the first quarter they belong to as below:

StarRatingsQtr =
SWITCH(
    TRUE(),
    'Date'[Month] >= 3 && 'Date'[Month] <= 5, "Mar QTR" & " " & 'Date'[Year]+1,
    'Date'[Month] >= 6 && 'Date'[Month] <= 8, "Jun QTR" & " " & 'Date'[Year]+1,
    'Date'[Month] >= 9 && 'Date'[Month] <= 11, "Sep QTR" & " " & 'Date'[Year]+1,
    'Date'[Month] = 1, "Dec QTR" & " " & 'Date'[Year],
    'Date'[Month] = 2, "Dec QTR" & " " & 'Date'[Year],
    'Date'[Month] = 12, "Dec QTR"& " " & 'Date'[Year]+1)
 
I have been able to create a column where I can list more than one period in for each date, however it is very manual and I still can't use it to filter effectively.  
TestStarRatings2 =
VAR _QTR124 = IF('Date'[Date] >= DATE(2023,06,01) && 'Date'[Date] <= DATE(2024,05,31), "Mar QTR 2024")
VAR _QTR224 = IF('Date'[Date] >= DATE(2023,09,01) && 'Date'[Date] <= DATE(2024,08,31), "Jun QTR 2024")
RETURN
    _QTR124 & ", " & _QTR224
 
Is there a way to have a column or measure that can be filtered as I need??
1 ACCEPTED SOLUTION
govind_021
Super User
Super User

Hi @hanrft 
I think you need to create a table where you should include one date in different time periods.
Please check out this video where there is similar kind of requiremnet 
https://youtu.be/hDopw1mPlrU?si=rXTDCP9zGBvzjBW3

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from govind_021 , please allow me to add some more information:
Hi  @hanrft ,

 

You can try to create a slicer table with “Mar25 QTR” “Jun25 QTR”, create a measure with the Switch() function to customize the rule, place the Filter with 1 or 0.

Here are the steps you can follow:

1. Home – Enter data – Create a slicer table.

vyangliumsft_0-1737623405352.png

2. Create measure.

Flag =
var _select=SELECTEDVALUE('Slicer_Table'[Group_Slicer])
RETURN
SWITCH(
    TRUE(),
_select="Mar25 QTR" && MAX('Table'[Date])>=DATE(2023,6,1) && MAX('Table'[Date])<=DATE(2024,5,31),1,
_select="Jun25 QTR" && MAX('Table'[Date])>=DATE(2023,9,1) && MAX('Table'[Date])<=DATE(2024,8,31),1,
_select="Sep QTR" && MAX('Table'[Date])>=DATE(2023,12,1) && MAX('Table'[Date])<=DATE(2024,11,30),1,
_select="Dec QTR" && MAX('Table'[Date])>=DATE(2024,3,1) && MAX('Table'[Date])<=DATE(2025,2,29),1,0)

3. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1737623405353.png

4. Result:

vyangliumsft_2-1737623455349.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

govind_021
Super User
Super User

Hi @hanrft 
I think you need to create a table where you should include one date in different time periods.
Please check out this video where there is similar kind of requiremnet 
https://youtu.be/hDopw1mPlrU?si=rXTDCP9zGBvzjBW3

Thank you! This is exactly what I am looking for in terms of filtering. 

Any ideas on how to set up the VAR logic so that I don't need to manually identify which period each date falls into?

 

If I do as suggested in video this is my formula:

StarRatingsPeriod =
VAR _Mar24QTR = ADDCOLUMNS(
    CALCULATETABLE(
    'Date',
     DATESBETWEEN('Date'[Date],DATE(2023,06,01),DATE(2024,05,31)))
    , "Star Ratings Period""Mar24 QTR")
VAR _Jun24QTR = ADDCOLUMNS(
    CALCULATETABLE(
    'Date',
     DATESBETWEEN('Date'[Date],DATE(2023,09,01),DATE(2024,08,31)))
    , "Star Ratings Period""Jun24 QTR")
RETURN
    UNION(_Mar24QTR,_Jun24QTR)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.