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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tameismael
Helper I
Helper I

Filter data based on prior year

Hello everyone,

 

In my table I added a new column I inserted the below formula :

 

Prior Year = IF(‘Table1’[Column1].[Date]<TODAY(),'Date Dimension'[PriorYearEndDate].[Year],TODAY().[Year])

 

I tried to implement the above formula in order to filter my data based on prior year but wasn’t successful and when I deleted the year part as highlighted above [Year], it got implemented but it didn’t give the correct results as years instead it gave me the numbers as  the below image in filters section. So as a result I need to see years in the filter section not Numbers. !!

 

 

tameismael_0-1633621356145.jpeg

 

 

2 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super User

Years are just numbers. I think you just need to adjust the formatting for the column to no commas and 0 decimal places.

 

 

View solution in original post

amitchandak
Super User
Super User

@tameismael , Not very clear, what you want to achieve here

 

You need this year vs last year flag

Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)

 

if you need measures refer 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Share with Power BI Enthusiasts: 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

2 REPLIES 2
amitchandak
Super User
Super User

@tameismael , Not very clear, what you want to achieve here

 

You need this year vs last year flag

Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)

 

if you need measures refer 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AlexisOlson
Super User
Super User

Years are just numbers. I think you just need to adjust the formatting for the column to no commas and 0 decimal places.

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.