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
RichFlorida
Helper IV
Helper IV

Dynamic Date filter on a Chart

 

Hello All,

 

I need to add a filter to my chart to make it display data for current_year only.

I want this filter to be dynamic, this year will be 2022, but next year will automatically change to 2023.

 

I can’t create new columns as I connect directly to DB.

 

Any ideas?

 

Thanks!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @RichFlorida ,

I created some data:

2019 1.1 – 2023.12.31

vyangliumsft_0-1655796410608.png

Here are the steps you can follow:

1. Create measure.

Flag =
IF(
    YEAR(MAX('Table'[Date]))=YEAR(TODAY()),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1655796410609.png

3. Result:

Only data for the current year will be displayed

vyangliumsft_2-1655796410612.png

 

Best Regards,

Liu Yang

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

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @RichFlorida ,

I created some data:

2019 1.1 – 2023.12.31

vyangliumsft_0-1655796410608.png

Here are the steps you can follow:

1. Create measure.

Flag =
IF(
    YEAR(MAX('Table'[Date]))=YEAR(TODAY()),1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1655796410609.png

3. Result:

Only data for the current year will be displayed

vyangliumsft_2-1655796410612.png

 

Best Regards,

Liu Yang

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

jdbuchanan71
Super User
Super User

Then you will proabaly have to add a column to your date table, something like FY offset that tags the current year as 0 and the previous year as -1 and the year before as -2, etc.  This would need to be dynamic so when it rolls to 2023, the year offset sets the correct dates as 0 to identify the current year.   Apply the year offset field as a filter on your report and set it to 0.

RichFlorida
Helper IV
Helper IV

Thank you @jdbuchanan71 

 

what is i'm interested in current Fiscal Year which starts in October 1st?

so, up tilll end of Sep it is one FY, starting Oct is is another..!

jdbuchanan71
Super User
Super User

@RichFlorida 

You can put a slicer on the page with the date and set it to relative, then select this year.

jdbuchanan71_0-1655477831334.png

When the meaning of 'this year' changes on 1/1/2023, the date range will shift automatically.

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.