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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
mjanecek
Helper I
Helper I

How to Make A relative Date Filter for Current Year

Hello: I would like to use a date column from my fact table to filter my data without using DAX and YTD functions if possible.

 

I woul like to filter all records in the current year of the Policy Date column.  The Is in the last 1 Years option gives me the last 52 weeks over the course of 2022 and 2023.

 

mjanecek_0-1675346748946.png

 

 

The in the last 1 calendar years option gives me the entirety of 2022.

 

mjanecek_2-1675346793209.png

I can accomplish my requirement by filtering anyting after 1/1/23, but that will require someone to change that filter when the calendar turns again.

mjanecek_3-1675346878111.png

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mjanecek , if there is no date filter, then a measure like this or visual filter on using this measure can help

 

This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,12 -1*month(today()) )
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

or try default date

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@mjanecek , if there is no date filter, then a measure like this or visual filter on using this measure can help

 

This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,12 -1*month(today()) )
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

or try default date

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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.