Forum Discussion
Anonymous
6 years agoNot applicable
Control Range Date by Dropdown filter
Hi all, I have a table calendar with data in each hour. I created a slicer for date between. I want to create a dropdown list which calculate today, last 7 days,... and when I choose one value,...
- 6 years ago
Hi Anonymous
A workaround below:
Create a date table
date = CALENDAR(MIN('Table'[date]),TODAY())add a column
slicer item = SWITCH ( TRUE (), [Date] = TODAY (), "today", DATEDIFF ( [Date], TODAY (), DAY ) <= 7 && [Date] < TODAY (), "last 7 days", DATEDIFF ( [Date], TODAY (), DAY ) <= 30 && [Date] < TODAY (), "last 30 days" )Then edit interactions as below
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
6 years agoCommunity Support
Hi Anonymous
A workaround below:
Create a date table
date = CALENDAR(MIN('Table'[date]),TODAY())
add a column
slicer item =
SWITCH (
TRUE (),
[Date]
= TODAY (), "today",
DATEDIFF (
[Date],
TODAY (),
DAY
) <= 7
&& [Date]
< TODAY (), "last 7 days",
DATEDIFF (
[Date],
TODAY (),
DAY
) <= 30
&& [Date]
< TODAY (), "last 30 days"
)
Then edit interactions as below
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mohammadyousaf
2 years agoResolver II
Thank you.