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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Convert a date field to the format "YYYY-MM" AND keep it as a type "Date" (rather than "Text")

We often report on data based on month so I often convert my dates to YYYY-MM so I can build reports and graph using that field.

 

My business user would like the Filter for "YYYY-MM" to be a slider rather than a drop-down filter so users do not have to click so many boxes to get the desired period.

 

It appears that if the "YYYY-MM" field is formatted as text, it will not give me the slider option on the filter.

 

I tried converting the months to the first date of each month and keeping it as a "date" type field to build a slider (1/1/2019, 2/1/2019, 3/1/2019, etc.) That works as a slider. However it shows the dates to the day granularity in the slider which implies that the data can be filtered by day which it cannot. I only want the slider to show the MONTHS since users can only filter from Month A to Month B.

 

If a user selects this, it implies they are including the first 7 days of March only. However, since the March data is all listed under Start of Month = "3/1/2020" this means that ALL March data will be included.

 

Annotation 2020-08-27 110617.jpg

 

 

 

 

 

So, my question is...is there a solution for creating a SLIDER filter in the format YYYY-MM OR which only shows distinct months on the slider options?

2 ACCEPTED SOLUTIONS
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Click on your date column, move it to a slicer and select Date Hierarcy:

Pragati11_1-1598541567785.png

 

Then just Year ans Month, you will get the slicer as follows:

Pragati11_2-1598541612266.png

 

You can't achieve a slider/scroller for Month Year date format.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

amitchandak
Super User
Super User

@Anonymous , You can mark YYYYMM as the number and you can use range. But that is not idle

 

or create as

Month Year = year([Date]) *100 + Month([Date])

 

Or use timeline slicer https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380786?tab=Overview

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , You can mark YYYYMM as the number and you can use range. But that is not idle

 

or create as

Month Year = year([Date]) *100 + Month([Date])

 

Or use timeline slicer https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380786?tab=Overview

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Click on your date column, move it to a slicer and select Date Hierarcy:

Pragati11_1-1598541567785.png

 

Then just Year ans Month, you will get the slicer as follows:

Pragati11_2-1598541612266.png

 

You can't achieve a slider/scroller for Month Year date format.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Thank you @Pragati11 . I understand the solution you are suggesting and I believe that will meet the user's needs.

 

However, something must not be working correctly for me. I have created the column "Start of Month" and it is formatted as a date field MM/dd/YY.

 

start of month.jpg

 

However, when I drag that field over to the filter and click "Date Hierachy", it ONLY shows me the year option. Normally it should show year, quarter, month and day and then you X out the ones you do not want to use.

 

Do you know why it would not be automatically showing me the full list of date options?

 

date.jpg

HI @Anonymous ,

 

Can you expand hierarchy of your START DATE column and share screenshot?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

This is unexpected behavior. When I drag the Start of Month to a table, it shows the full hiearchy and has all of the values checked in the "Fields" pane. See bottom table. 

 

However, when I drag Start of Month to a slicer, it only pulls the year. If I try to click on the month, quarter or day to add that to the slicer, it will not allow me to add that to the slicer.

 

Maybe it's a bug of some sort?

 

Annotation 2020-08-27 163021.jpg

Anonymous
Not applicable

Thank you @amitchandak . I looked at the timeline slicer and that is exactly what I would like to be able to use. However, my company is on an older version of Power BI and that is not an option. I wasn't clear if that's a custom app that has to be downloaded but in my organization, I do not think that will be an option at this point so I will look at other workarounds.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.