Forum Discussion
Show Tasks in specific month using date slicer
- 6 years ago
Hi, Haya
Based on your description, I created data to reproduce your scenario.
You may create a Date table as follows.
Calendar = CALENDARAUTO()Then you can create a measure as below.
IsProcess = var _mindaterange = CALCULATE( MIN('Calendar'[DateRange]), FILTERS('Calendar'[DateRange]) ) var _maxdaterange = CALCULATE( MAX('Calendar'[DateRange]), FILTERS('Calendar'[DateRange]) ) return IF( NOT OR(_maxdaterange<MAX('Table'[Start Date]),_mindaterange>MAX('Table'[End Date])), 1,0 )Finally you need to put the measure to the visual level filter. Here are the results.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Haya
Based on your description, I created data to reproduce your scenario.
You may create a Date table as follows.
Calendar = CALENDARAUTO()
Then you can create a measure as below.
IsProcess =
var _mindaterange =
CALCULATE(
MIN('Calendar'[DateRange]),
FILTERS('Calendar'[DateRange])
)
var _maxdaterange =
CALCULATE(
MAX('Calendar'[DateRange]),
FILTERS('Calendar'[DateRange])
)
return
IF(
NOT OR(_maxdaterange<MAX('Table'[Start Date]),_mindaterange>MAX('Table'[End Date])),
1,0
)
Finally you need to put the measure to the visual level filter. Here are the results.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks v-alq-msft
I followed your step but the output is incorrect
would you please explain this line of the code:
return
IF(
NOT OR(_maxdaterange<MAX('Table'[Start Date]),_mindaterange>MAX('Table'[End Date])),
1,0
)- v-alq-msft6 years agoCommunity Support
Hi, Haya
The formula excludes the wrong results, where the minimum value of date range is greater than the current 'End Date' or the maximum value of date range is less than the current 'Start Date'. Then the remaining cases satisfy the condition.
Best Regards
Allan
- Haya6 years agoHelper II
Thanks v-alq-msft
I followed your approch and I used matrix to visual number of tasks for each employee
for example:
Name # Tasks Haya 2 Sara 2 Ali 1 Using the slicer, I want to show the tasks in specific month (ex. March), however, using your approach, if one of the tasks is on March, it will show me all number of tasks.
Example: select March in date slicer, it will show me
Name # Tasks Haya 2 where it should be
Name #Tasks Haya 1 - v-alq-msft6 years agoCommunity Support
Hi, Haya
Here is the example you provided.
Then I created the following measure to count tasks.
Tasks = COUNTROWS(ALLSELECTED('Table'))Here is the result.
There is only 'Ali' satisfy the condition which is between 3/1/2020 and 3/31/2020. So the result is 1. I wonder if there is any difference with the sample data.
Best Regards
Allan