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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors