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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
manoj_0911
Post Patron
Post Patron

How to enable date slicer only when "Single Date" option is selected?

Hi all,

I’m building an intra-day Power BI report and I have a requirement to control the behavior of date filters based on a user selection.

I’ve created a disconnected table DatePeriods with 3 options:

  • Today

  • Yesterday

  • Single Date

    Expected behavior:

    • When the user selects "Today" or "Yesterday", the report should show data for today or yesterday automatically.

    • When the user selects "Single Date", only then the date slicer (from the main Date table) should become active and allow them to select a custom date.

    • If any other option is selected, the date slicer should appear disabled or hidden.

      I’ve written a measure like below to calculate the selected date:

      DatePeriods =
      UNION(
          // Today
          ADDCOLUMNS(
              FILTER(CALENDAR(MIN('Date'[Date]), MAX('Date'[Date])), [Date] = TODAY()),
              "Type", "Today",
              "Sort", 1
          ),
          // Yesterday
          ADDCOLUMNS(
              FILTER(CALENDAR(MIN('Date'[Date]), MAX('Date'[Date])), [Date] = TODAY() - 1),
              "Type", "Yesterday",
              "Sort", 2
          ),
          // Custom Range (Allow users to select this and manually adjust dates)
          ADDCOLUMNS(
              CALENDAR(MIN('Date'[Date]), MAX('Date'[Date])),
              "Type", "Custom",
              "Sort", 3
          )
      )
       

      I want to show or enable the date slicer only when "Single Date" is selected. Is there a recommended way to implement this in Power BI?

       

      Thanks in advance!

2 ACCEPTED SOLUTIONS
Rupak_bi
Super User
Super User

Hi @manoj_0911 ,

Slicer works on column. to make this, create a calculated column in the table having dates, and classify it as today, yesterday and single date. now use that column for first slicer and date column as second.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

View solution in original post

v-pgoloju
Community Support
Community Support

Hi @manoj_0911,

 

Thanks for posting your question in the Microsoft Fabric Forum Community. And also thanks to @Rupak_bi for prompt and helpful response.


To control how the date slicer works based on what the user picks:

create a separate table with three choices: Today, Yesterday, and Single Date. Add a slicer using this table so users can choose one of those options.

Based on what they pick, show data for today, yesterday, or let them pick a specific date. Instead of using the date slicer directly, use a calculation to decide what date to show.

To make the date slicer usable only when "Single Date" is picked:

You can put a shape or message over it to block it when not needed, or Use a setting to hide the slicer completely unless "Single Date" is selected.


Thanks & regards,
Prasanna Kumar

View solution in original post

5 REPLIES 5
v-pgoloju
Community Support
Community Support

Hi @manoj_0911,

 

Just a gentle reminder  has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.

This not only closes the loop on your query but also helps others in the community solve similar issues faster.

Thank you for your time and feedback!

 

Best,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @manoj_0911,

 

We wanted to kindly check in to see if everything is working as expected after trying the suggested changes to craete a new table for seletions. If there’s anything else we can assist with, please don’t hesitate to ask.

 

Warm regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @manoj_0911,

 

Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

 

Best regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @manoj_0911,

 

Thanks for posting your question in the Microsoft Fabric Forum Community. And also thanks to @Rupak_bi for prompt and helpful response.


To control how the date slicer works based on what the user picks:

create a separate table with three choices: Today, Yesterday, and Single Date. Add a slicer using this table so users can choose one of those options.

Based on what they pick, show data for today, yesterday, or let them pick a specific date. Instead of using the date slicer directly, use a calculation to decide what date to show.

To make the date slicer usable only when "Single Date" is picked:

You can put a shape or message over it to block it when not needed, or Use a setting to hide the slicer completely unless "Single Date" is selected.


Thanks & regards,
Prasanna Kumar

Rupak_bi
Super User
Super User

Hi @manoj_0911 ,

Slicer works on column. to make this, create a calculated column in the table having dates, and classify it as today, yesterday and single date. now use that column for first slicer and date column as second.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.