cancel
Showing results for
Did you mean:
Frequent Visitor

slicer filter with time interval

Hi Team,

I have to create a slicer filter with date column intervals, colunm name current_end_date in my table

if (interval([Current End Date] - today(), 'd') < 0, 'expired',
if (interval([Current End Date] - today(), 'd') > 0  and interval([Current End Date] - today(), 'd') < 30, 'less than 30 days',
if (interval([Current End Date] - today(), 'd') > 31 and interval([Current End Date] - today(), 'd') < 60 , 'less than 60 days',
if (interval([Current End Date] - today(), 'd') > 61 and interval([Current End Date] - today(), 'd') < 90 , 'less than 90 days',
'more than 90 days'))))

like this kind of calculations. So the Slicer should display 5 options like above image.

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

Re: slicer filter with time interval

Hi @Nimmi,

You can add a column and try this formula.

```Column =
VAR interval =
DATEDIFF ( [Current End Date], TODAY (), DAY )
RETURN
SWITCH (
TRUE (),
interval < 0, "expired",
interval > 0
&& interval < 30, "less than 30 days",
interval > 31
&& interval < 60, "less than 60 days",
interval > 61
&& interval < 90, "less than 90 days",
"more than 90 days"
)
```

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Regular Visitor

Re: slicer filter with time interval

Create a new calculated column with "IF" statement and use the same formula you mentioned below.

Regards,

Shakeel

Super Contributor

Re: slicer filter with time interval

Hi @Nimmi,

You can add a column and try this formula.

```Column =
VAR interval =
DATEDIFF ( [Current End Date], TODAY (), DAY )
RETURN
SWITCH (
TRUE (),
interval < 0, "expired",
interval > 0
&& interval < 30, "less than 30 days",
interval > 31
&& interval < 60, "less than 60 days",
interval > 61
&& interval < 90, "less than 90 days",
"more than 90 days"
)
```

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Get your latest community news and announcements.

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 279 members 3,306 guests
Recent signins: