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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Meeresblume
Helper I
Helper I

filter with choices Last 7 days, last 14 days and this Year

Hello,

Is there a way to create the filter like this?


The user should have 3 buttons to choose from in which the filtering of the table below can be adjusted. The buttons should read Last 7 days, Last 14 days and This year. He should also have the opportunity to independently select a date range.

 

Example:

Meeresblume_0-1699874158100.png

 

Thanks for your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Meeresblume ,

One option would be to create a calculation group with items for each period you want to cover, e.g.

Last 7 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 7, TODAY () )
)
Last 14 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 14, TODAY () )
)
last year =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], EOMONTH ( TODAY (), -13 ) + 1, TODAY () )
)

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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
Anonymous
Not applicable

Hi @Meeresblume ,

One option would be to create a calculation group with items for each period you want to cover, e.g.

Last 7 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 7, TODAY () )
)
Last 14 days =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], TODAY () - 14, TODAY () )
)
last year =
CALCULATE (
    SELECTEDMEASURE (),
    DATESBETWEEN ( 'Date'[Date], EOMONTH ( TODAY (), -13 ) + 1, TODAY () )
)

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

 

mh2587
Super User
Super User

If you have measures for last 7 days , last 14 days and this year ,  Just drag those measures in field parameter and put the measure value of this parameter in visual so it will suit your requirements


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



It is a normal date (01-01-2023). I don't have Measure and I wouldn't know how I should create it so that it fits the selection.

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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