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.
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!
Solved! Go to Solution.
@Anonymous
There you go.... Here is the link to pbix if you want to refer.
https://drive.google.com/open?id=15Mtuw6TSIGdpYa51Mfd3TAeuhAQmh4JI
Hope this helps !!
Please mark it as accepted if the solution was appropriate.
Thanks
@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 slicer
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
Hope this helps !!
Please mark it as accepted if the solution was appropriate.
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |