Forum Discussion
create single dropdown with thisWeek, thisMonth, thisYear and date slicer based on the selection.
- Anonymous2 years ago
Hi pavithra_viki ,
I agree with lbendlin's reply. As far as I know, Power BI doesn't support us to achieve this in between type slicer.
Sometimes we will try to add a measure into visual level filter to filter visual dynamicly with an unrelated slicer.
Here is my sample.
Measure = IF(ISFILTERED('Table'[Selection]), SWITCH( MAX('Table'[Selection]), "Week",IF(MAX('Calendar'[WeekStart]) = TODAY()-WEEKDAY(TODAY(),1)+1,1,0), "Month",IF(MAX('Calendar'[Year])*100+MAX('Calendar'[Month]) = YEAR(TODAY())*100+MONTH(TODAY()),1,0), "Year",IF(MAX('Calendar'[Year]) = YEAR(TODAY()),1,0), "Custom",1),0)Add this measure into visual level filter and set it to show items when value = 1.
We can see that it could work in list or drop type slicer, and wouldn't work in between type slicer.
Here I suggest you to try Relative Date function in this slicer.
in this week:
in this month:
in this year:
Custom = remove all filters to show all data.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pavithra_viki ,
I agree with lbendlin's reply. As far as I know, Power BI doesn't support us to achieve this in between type slicer.
Sometimes we will try to add a measure into visual level filter to filter visual dynamicly with an unrelated slicer.
Here is my sample.
Measure =
IF(ISFILTERED('Table'[Selection]),
SWITCH(
MAX('Table'[Selection]),
"Week",IF(MAX('Calendar'[WeekStart]) = TODAY()-WEEKDAY(TODAY(),1)+1,1,0),
"Month",IF(MAX('Calendar'[Year])*100+MAX('Calendar'[Month]) = YEAR(TODAY())*100+MONTH(TODAY()),1,0),
"Year",IF(MAX('Calendar'[Year]) = YEAR(TODAY()),1,0),
"Custom",1),0)
Add this measure into visual level filter and set it to show items when value = 1.
We can see that it could work in list or drop type slicer, and wouldn't work in between type slicer.
Here I suggest you to try Relative Date function in this slicer.
in this week:
in this month:
in this year:
Custom = remove all filters to show all data.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the idea.
Can you help me by sharing your pbix. Would you like to go throw the methods and I could implement ?
- Anonymous2 years agoNot applicable
Hi pavithra_viki ,
You can download my attatchment to learn more details.
I hope it could help you solve your issue.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.