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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Filter out year and month from date/time table

Hi

 

I have a date/time table like this: ( as you can see not all dates are unique )
datetime.PNG

I need to make 2 slicer filters now: 1 for year and 1 for month so in dropdown I could pick year 2019 and another dropdown month "January" and it would show me all the data in January 2019. I tried to make a copy column of the date table and choose format 2001(yyyy) so it would only show year but in dropdown then of course I have thousands of 2020's. It shouldn't be a hard problem I think but haven't found any solutions in google yet.

 

PS. Just in case I want to mention that I'm working with livequery. Import is not an option

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I think the reason that the Slicer displays thousands of the 2020s is that you do not create a hierarchy for the date column, you can follow these links to create a hierarchy for the date column and place [Year] and [Month] for the two Slicers you created.

https://www.youtube.com/watch?v=x6vXVJZ_eTY

https://spreadsheeto.com/power-bi-hierarchy/

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I think the reason that the Slicer displays thousands of the 2020s is that you do not create a hierarchy for the date column, you can follow these links to create a hierarchy for the date column and place [Year] and [Month] for the two Slicers you created.

https://www.youtube.com/watch?v=x6vXVJZ_eTY

https://spreadsheeto.com/power-bi-hierarchy/

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Microsoft Employee
Microsoft Employee

I would encourage you to make a Date table and then a separate Time table, and split your fact table column into date and time columns to relate to the Date and Time tables.  This will significantly reduce # of rows/file size and will make analysis easier, more flexible, and faster.

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors