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
tommy_g
Helper V
Helper V

Date Slicer Granularity - I'd like it to slice only at the year level

I have data which needs to be sliced only at the year level. I've modified my date to month 1, day 1, giving me "1/1/year". Also adjusted formatting to "YYYY". The client loves the Date Slicer, but it insists on using full "M/D/YYYY" with the slider.

I know I can set other options for year, but they don't look as slick, and client prefers "slick". (me too)

 

Desired result would be display of years only, with year increasing or decreasing.

 

Granularity of Date Slicer.JPG

2 ACCEPTED SOLUTIONS

@tommy_g As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

Once you have a date dimension, just use Year from date dimension, and yes you will see the slider with the number column used in the slicer.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

@tommy_g yes, once you convert year to number and use it on the slicer, it will show slider and allows you to pick between years.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

9 REPLIES 9
amitchandak
Super User
Super User

@tommy_g , if you have Year as number data type, you can use between range ?

Yes, year level works in the slicer. My original date table, which I probably created several years ago, year, month and days were defined as character values. I have no idea why, but when changing to integers I can use the slider option. The complication I ran into is obvious in retrospect: on the screen, 2019 looks the same whether text or numeric.

Digging deeper into my date table, I see that my year, month and day columns are set to "text" data type. 

I do not remember when or why i did this, investigating now.

 

Presumably the slicer prefers numbers as "between" values. I think my two decades of VB programming have led me to expect too much in terms of "between"!

@tommy_g yes, once you convert year to number and use it on the slicer, it will show slider and allows you to pick between years.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Updating my previous comments, the date slicer "between" sliders support both "official dates" at the granularity of day, AND numeric years when the year column is defined as a whole number. The advantage of using numeric "years" is the slicer then does not show extraneous month and day values.

parry2k
Super User
Super User

@tommy_g why not you use year in the slicer, you can still have the slider, wat's the point showing the date if you are always slicing on a year, just an idea.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hey, good question!

 

The table is not currently linked to a data table, it's just a simple list.

 

I did try using my internal date table with the slicer as a test.

 

However it only provides for list and dropdown options, the desired "between" option for the sliders is not available.

 

As far as I can tell, the sliders are ONLY available with a simple date.

@tommy_g As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

Once you have a date dimension, just use Year from date dimension, and yes you will see the slider with the number column used in the slicer.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

"Once you have a date dimension, just use Year from date dimension, and yes you will see the slider with the number column used in the slicer."

 

I already have a marked data table. If I add the date field to the slicer I can use the "between" to activate the slider.

 

If I select anything from the date hierarchy the slicer will accept it but NOT allow use of the "between" sliders.

 

As far as I can tell, the slicer requires an actual data value (i.e. a column showing the date icon).

 

Perhaps you can clarify your comment "slider with the number column", I'm not sure what number you are referencing. 

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.