Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Nimmi
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 tableCapture5.PNG

 

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.

 

Please help me on this.

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

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.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

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.
shakeelsyed
Helper I
Helper I

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

 

Hope that resolve your query.

 

Regards,

Shakeel

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors