Forum Discussion
Date slicer - Multi dates
- 4 years ago
Hi Anonymous
Based on test, we haven’t found a method to put Date column and Slicer Date column to same table visual. But you may consider this solution.
1 Create a Slicer with Date column from Slicer table
2 Create a Measure to set flag for Date column from Date table
Flag =
var _selecteddate=SELECTEDVALUE('Slicer'[Date])
var _weeknum=WEEKNUM(_selecteddate)
var _weekday=WEEKDAY(_selecteddate,2)
return
SWITCH(
_weekday,
1,IF(MAX('calender'[Date])=_selecteddate-3,1,0),
2,IF((MAX('calender'[Date])>=_selecteddate-3&&MAX('calender'[Date])<=_selecteddate-1),1,0),
IF(MAX('calender'[Date])=_selecteddate-1,1,0))
3 Use Date column to create Table visual and use Flag measure to set filter on this visual
4 Select a date in Slicer, you will get expected date in Table visual
For more details, you can refer to the uploaded pbix file.
Best Regards,
Community Support Team _ Caiyun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have questions, please feel free to let me know. Thanks in advance!
Hi Anonymous
Based on test, we haven’t found a method to put Date column and Slicer Date column to same table visual. But you may consider this solution.
1 Create a Slicer with Date column from Slicer table
2 Create a Measure to set flag for Date column from Date table
Flag =
var _selecteddate=SELECTEDVALUE('Slicer'[Date])
var _weeknum=WEEKNUM(_selecteddate)
var _weekday=WEEKDAY(_selecteddate,2)
return
SWITCH(
_weekday,
1,IF(MAX('calender'[Date])=_selecteddate-3,1,0),
2,IF((MAX('calender'[Date])>=_selecteddate-3&&MAX('calender'[Date])<=_selecteddate-1),1,0),
IF(MAX('calender'[Date])=_selecteddate-1,1,0))
3 Use Date column to create Table visual and use Flag measure to set filter on this visual
4 Select a date in Slicer, you will get expected date in Table visual
For more details, you can refer to the uploaded pbix file.
Best Regards,
Community Support Team _ Caiyun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have questions, please feel free to let me know. Thanks in advance!
- Anonymous4 years agoNot applicable
Thanks Caiyun, this alternate solution worked.