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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jayala
Frequent Visitor

Fixed time range

Hi guys,

 

I have a dataset that I need to filter by a fixed windows range time of 12 months.

 

I tried using two slicers: one with the "After" option for the Start date and a second one using a Measure (StartDate + 365) but it does not work.

 

Do you know how to perform this kind of custom slicing?

 

Thank you in advance.

 

1 ACCEPTED SOLUTION

Hi @jayala ,

You just want to show the values for 12 months after the selected date. Right? If so, I think you could create a measure like below:

Selected Date + 365 =
CALCULATE (
    SUM ( 'Table'[ Sales] ),
    FILTER ( 'Table', 'Table'[Date] >= MIN ( 'Date'[Date] ) + 365 )
)

If you want to show the values which is between selected date and 12 months after that, please try this:

selected date to Selected Date + 365 =
CALCULATE (
    SUM ( 'Table'[ Sales] ),
    FILTER (
        'Table',
        'Table'[Date] >= MIN ( 'Date'[Date] )
            && 'Table'[Date]
                <= MIN ( 'Date'[Date] ) + 365
    )
)

 2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

3 REPLIES 3
amitchandak
Super User
Super User

When you use date in slicer you have the option to use the Relative option. The same is also available if you drag date into filter pane.

 

Screenshot 2019-12-24 19.21.20.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog -

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...


https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @amitchandak thank you for your answer but I need something a little bit different. Let's assume that I select a specific Start Date present in my data set, I need to see only data for 12 months after the chosen date.

 

The relative option seems to be relative to the current date. Am I right?

 

Thank you again.

Hi @jayala ,

You just want to show the values for 12 months after the selected date. Right? If so, I think you could create a measure like below:

Selected Date + 365 =
CALCULATE (
    SUM ( 'Table'[ Sales] ),
    FILTER ( 'Table', 'Table'[Date] >= MIN ( 'Date'[Date] ) + 365 )
)

If you want to show the values which is between selected date and 12 months after that, please try this:

selected date to Selected Date + 365 =
CALCULATE (
    SUM ( 'Table'[ Sales] ),
    FILTER (
        'Table',
        'Table'[Date] >= MIN ( 'Date'[Date] )
            && 'Table'[Date]
                <= MIN ( 'Date'[Date] ) + 365
    )
)

 2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.