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
Koritala
Helper IV
Helper IV

Custom Date Range Slicer

Hi,

Could you help me with the scenario below?

 

I want to dynamically show the 2 differnt date slicers based on slicer value slection.

 

In slicer, I should have 2 values, one is MTD, second one is custom.

 

If user select MTD option in the slicer, it should return the date range slicer and it should enable the dates range from 1st of current month to till current date( For history and future dates, it should not allow user to select)

If user select custom in the slicer, it should display date range slicer without any restrictions(like should allow all history and future dates as well).

Can any one share the sample pbxi file?

 

Thanks,

Sri

1 ACCEPTED SOLUTION

Hi Ugendar,
Thanks for your solution. it working as expected.

View solution in original post

15 REPLIES 15
V-yubandi-msft
Community Support
Community Support

Hi @Koritala ,
Could you please let us know whether your issue has been resolved or if you are still encountering any difficulties? Your feedback is important to the community and may assist others with similar concerns.

Thank You.

Hi, issue not resolved. Based on selection, date slicers are not showing 

 

 

Hi @Koritala ,

Thank you for your time. Since Power BI doesn’t offer conditional slicer visibility directly, I used bookmarks and the Selection pane to toggle between two slicers.
Here’s what I did.

1.Created a helper table with MTD and Custom values and used it as a slicer.

2. Slicer_Date_MTD- Set advanced filtering to show dates from the start of this month to today.

3. Slicer_Date_Custom- left unfiltered for the full date range.

4. Set up bookmarks

  • Bookmark_MTD shows the MTD slicer and hides the Custom slicer.
  • Bookmark_Custom shows the Custom slicer and hides the MTD slicer.

5. Added two buttons MTD View and Custom View linked to each bookmark, so users can switch modes easily.

FYI:

Vyubandimsft_0-1761320957388.pngVyubandimsft_1-1761320968013.png

 

 

This method uses only built in Power BI features and keeps the interface simple. I’ve attached a sample PBIX file for you to review let me know if you want any changes.

 

Regards,
Yugandhar.

Hi Ugendar,
Thanks for your solution. it working as expected.

Thank you for your response, @Koritala . If possible, please mark the helpful response as the solution so it can benefit other community users more easily.

I'm glad you found a solution! We're here in the community to support each other.

V-yubandi-msft
Community Support
Community Support

Hi @Koritala ,

Apologies for the delayed response.

As of now, Power BI doesn’t natively support this requirement. However @Ilgar_Zarbali  suggested workaround, I’ve implemented a solution using two slicers combined with bookmarks, and tested it with sample data.
FYI:

Vyubandimsft_0-1760724472725.png


Vyubandimsft_1-1760724492341.png

 

 

For your reference, I’ve attached a PBIX file please feel free to explore the logic and setup.

Thanks again, @Ilgar_Zarbali , for your valuable input.

Hope this helps.

Best regards,
Yugandhar.

V-yubandi-msft
Community Support
Community Support

Hi @Koritala ,
If you've had a chance to review @Kedar_Pande  response? please let us know if you need any additional information or clarification. We're happy to assist further if needed.

 

Thank You.

Kedar_Pande
Super User
Super User

  

Create a disconnected table with values MTD and Custom.

Use a measure to set min/max dates based on the selected value, e.g.:

DateFilter =
IF(SELECTEDVALUE(Slicer[Type]) = "MTD",
Dates[Date] >= STARTOFMONTH(TODAY()) && Dates[Date] <= TODAY(),
TRUE()
)

Apply this as a visual-level filter on your date slicer.

 
 

@Koritala

Hi Kedhar,

can you please share the pbxi file. I couldn't get the result.

Thanks,

Sri

Hi Kedhar,

Can you share the pbxi file for your solution.

Thanks,

Sri

Hi Kedar,

Can you share the pbxi if have for the same?

Thanks,

Sri

Ilgar_Zarbali
Super User
Super User

Short version: you can’t “re-program” a single Date slicer so that its selectable range changes based on another slicer. Slicers only accept column filters, not measure logic, so they can’t react that way.

You have two practical patterns:

 

A) Best UX (two slicers + bookmarks)

 

1. Create a disconnected selector:

 

Mode =
DATATABLE ( "Mode", STRING, { { "MTD" }, { "Custom" } } )

 

2. Put two Date slicers on the page:

  • Slicer 1 (MTD) → a Relative date slicer set to This month.
  • Slicer 2 (Custom) → a normal Between slicer over Date[Date].

3. Use Selection pane + Bookmarks:

  • Bookmark MTD: show Slicer 1, hide Slicer 2.
  • Bookmark Custom: show Slicer 2, hide Slicer 1.
  • Add a Bookmark navigator tied to the two bookmarks, or use the Mode slicer to trigger them.

This gives exactly the behavior you want: user picks MTD → the “This Month” slicer is shown; user picks Custom → a free date-range slicer is shown.

 

B) Single slicer (limit the effect with a measure)

If you prefer one visible slicer, you can’t restrict its UI, but you can restrict how dates affect visuals when MTD is chosen.

1. Same disconnected Mode table as above.

2. Create a filter measure:

 

Date Filter :=
VAR ModeSel = SELECTEDVALUE ( Mode[Mode], "Custom" )
VAR D = MAX ( 'Date'[Date] )
VAR StartM = DATE ( YEAR ( TODAY() ), MONTH ( TODAY() ), 1 )
RETURN
IF (
ModeSel = "MTD",
IF ( D >= StartM && D <= TODAY(), 1, 0 ),
1
)

 

3. Put your normal Between Date slicer on Date[Date].

4. Add Date Filter to the Visual-level filters for all visuals that should respect the rule and set it to is 1.

 

  • When Custom is selected, visuals follow the date slicer normally (all past/future dates allowed).
  • When MTD is selected, visuals ignore selections outside the range 1st of current month → today (future and history outside MTD are effectively blocked in visuals).

 

I hope it helps.

 

 

 

 

 

 

Hi Ilgar,

Thanks for your email.

Could you please share pbxi file if you already worked on this?

Thanks,

Sri.

TomMartens
Super User
Super User

Hey @Koritala ,

 

This is not possible.

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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