Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
@ashrin,
"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.
Regards,
Lydia
@ashrin,
"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.
Regards,
Lydia
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.
@ashrin,
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |