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

Current Year Slicer

Hi Everyone,

 

I have a slicer that I created using DAX that shows all months and labels the current month as "Current Month" I would like to do the same thing with a year slicer that shows all year but labels this year as "Current Year". I've attached an image for reference.

 

However, I keep running into the issue that years are numbers, and "Current Year" is a text. 

 

Is it possible to create this slicer? How would I go about doing it?

 

Thanks!

Image 6.png

1 ACCEPTED SOLUTION

@Anonymous 

 

There you go.... Here is the link to pbix if you want to refer. 

 

https://drive.google.com/open?id=15Mtuw6TSIGdpYa51Mfd3TAeuhAQmh4JI

Capture2.PNG

 

 

Hope this helps !!

 

Please mark it as accepted if the solution was appropriate.

 

Thanks

View solution in original post

3 REPLIES 3
JIGAR
Resolver IV
Resolver IV

@Anonymous 

 

You can create a custom column in your Power BI Editor. You can use this formula

 

NewYear = if([Year] = Date.Year(DateTime.LocalNow())) then "Current Year"
else
[Year]

 

Change the type of this NewYear column to text. 

 

You might have to handle the way these values are sorted on your slicerCapture.PNG

 

Hope this helps !!

 

Thanks

 

 

 

 

@Anonymous 

 

There you go.... Here is the link to pbix if you want to refer. 

 

https://drive.google.com/open?id=15Mtuw6TSIGdpYa51Mfd3TAeuhAQmh4JI

Capture2.PNG

 

 

Hope this helps !!

 

Please mark it as accepted if the solution was appropriate.

 

Thanks

Anonymous
Not applicable

@JIGAR Thank you, very helpful!

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.