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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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 REPLIES 2
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
Impactful Individual
Impactful Individual

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
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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