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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AsNa_92
Resolver II
Resolver II

Create Period slicer based on Date

Hi Guys

 

I have Date column and I want to create slicer with 1D/ 1W/ 1M/ 3M/ 6M and All.

Can you please assist me on how to elaborate that?

 

AsNa_92_0-1724758112659.png

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @AsNa_92 - you can add a calculated column to your Date table that categorizes each date based on the defined periods (1D, 1W, 1M, 3M, 6M, and All).

Period =
VAR CurrentDate = MAX('Datetable_W'[Date])
RETURN
SWITCH(
    TRUE(),
    'Datetable_W'[Date] >= CurrentDate - 1, "1D",
    'Datetable_W'[Date] >= CurrentDate - 7, "1W",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -1), "1M",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -3), "3M",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -6), "6M",
    "All"
)

 

rajendraongole1_0-1724759232834.png

 

i have added the above column in my visual with slicer chart and it looks as expected from above snap

rajendraongole1_2-1724759374205.png

 

 

 

Hope this helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @AsNa_92 ,

 

Is your problem solved? If it is solved, you can mark the correct answer as a marker, if not, provide more detailed information and we can help you better!

 

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.

rajendraongole1
Super User
Super User

Hi @AsNa_92 - you can add a calculated column to your Date table that categorizes each date based on the defined periods (1D, 1W, 1M, 3M, 6M, and All).

Period =
VAR CurrentDate = MAX('Datetable_W'[Date])
RETURN
SWITCH(
    TRUE(),
    'Datetable_W'[Date] >= CurrentDate - 1, "1D",
    'Datetable_W'[Date] >= CurrentDate - 7, "1W",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -1), "1M",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -3), "3M",
    'Datetable_W'[Date] >= EDATE(CurrentDate, -6), "6M",
    "All"
)

 

rajendraongole1_0-1724759232834.png

 

i have added the above column in my visual with slicer chart and it looks as expected from above snap

rajendraongole1_2-1724759374205.png

 

 

 

Hope this helps

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors