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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Dynamic date slicer that can be used in a calculated Dax column

I currently have a Slicer that has 3 options : Active, Inactive and Future. These option come from a calculated column like this :

IF startdate <= TODAY() && enddate >= TODAY(), "Active",

IF enddate < TODAY(), "Termed",

IF start_date > TODAY(), "Future"

 

I need to create a slicer that will let me select a date and based on that date, it should give me Active, Inactive, Future instead of just having TODAY(). is this possible ? 

Im using imported date from MSSQL

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous,

"I need to create a slicer that will let me select a date and based on that date, it should give me Active, Inactive, Future instead of just having TODAY(). is this possible ? "

Create a calendar table using dax below.

calendar = CALENDAR("1/1/2016","12/30/2018")


Create a measure in your original table.

checkdate = IF(MAX(Table[startdate] )<= MAX('calendar'[Date]) &&MAX( Table[enddate] )>=MAX('calendar'[Date]), "Active", IF(MAX(Table[enddate]) < MAX('calendar'[Date]), "Termed",IF( MAX(Table[startdate] )> MAX('calendar'[Date]), "Future")))


Create date slicer using date field of calendar table.
1.PNG

Regards,
Lydia

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous,

"I need to create a slicer that will let me select a date and based on that date, it should give me Active, Inactive, Future instead of just having TODAY(). is this possible ? "

Create a calendar table using dax below.

calendar = CALENDAR("1/1/2016","12/30/2018")


Create a measure in your original table.

checkdate = IF(MAX(Table[startdate] )<= MAX('calendar'[Date]) &&MAX( Table[enddate] )>=MAX('calendar'[Date]), "Active", IF(MAX(Table[enddate]) < MAX('calendar'[Date]), "Termed",IF( MAX(Table[startdate] )> MAX('calendar'[Date]), "Future")))


Create date slicer using date field of calendar table.
1.PNG

Regards,
Lydia

Anonymous
Not applicable

Thanks so much. 

 what Im trying to do is :

We have a list of people who are either active, termed or future active. these people all have a start date and an end date. i have a slicer where i can select "Active", "termed", "Future". when i click on active, all the people who are active today show up. when i click termed, all who were active before today and not active anymore will show up, if the start date is greater than today, then future active records will show up. 

Now, all these options are relative to todays date. I want to do this based on a date other than today(future or past). So when i select a date, the active, termed and future records show up based on the date i select not not today.

I would like this date to be a single select date and not a range.

 

Basically your solution works, to an extent. I also need a slicer that would let me select active, termed and future.

Anonymous
Not applicable

@Anonymous,

It is not possible to drag a measure to slicer, you can drag the measure into visual level filter and then set different values.

Based on my understanding, you check the user status by creating a calculated column containing active, inactive and so on, however, in this case, calculated column can't be changed dynamically based on slicer selection(date slicer in your scenario), please review this KB to get details.

Regards,
Lydia

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.

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