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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
CM12345Office
New Member

Help with filtering Date Hierachy

Hello,

 

I am having trouble around creating a date slicer.

 

I have a date table that starts from June 25 (As I have no data earlier than that).

CM12345Office_0-1761859274612.png

This works as a slicer but only monthly data is relevant so I need to group it. When I group it however, the date hierachy shows options from the start of the year that I don't want to be visible. Putting a date filter on the visual also doesn't seem to work.

CM12345Office_1-1761859441023.png

CM12345Office_2-1761859453746.png

CM12345Office_3-1761859557759.png

 

How can I create a a date slicer, in for format [Year][Month], that doesn't show options where I have no data?

 

Kind regards,

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

If you create a Calendar table using this DAX calculated table formula, then you will not face this problem

Calendar = calendar(min(Data[Date]),max(Data[Date]))

Also, in the Calendar table, create calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  To your visual, drag Year and Month name from the Calendar table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @CM12345Office,

 

Has your issue been resolved?
If the response provided by @Ashish_Mathur@danextian  addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.


Thank you.
 

Ashish_Mathur
Super User
Super User

Hi,

If you create a Calendar table using this DAX calculated table formula, then you will not face this problem

Calendar = calendar(min(Data[Date]),max(Data[Date]))

Also, in the Calendar table, create calculated column formulas for Year, Month name and Month number.  Sort the Month name column by the Month number.  To your visual, drag Year and Month name from the Calendar table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is how I have it setup currently, with Calendar(Min,Max) generating the table.

 

Wonder if there is a way to make this work with Automatically generated date heriachy rather than creating extra columns for Year/month.

 

Other reply of Filter by not blank didn't work. This was tested with no fact table, only a caleandar table.

You must create a Calendar table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @CM12345Office 

 

This is either because you are using the auto generated date hierarchy and some rows do not have a value or you're using a calendar table and there are dates in the fact table which are blanks or not covered by the calendar table. The simplest method is to add another visual filter, go to  advanced settings and select not blank. 

 

If you're using Auto date/time, please read this - https://data-mozart.com/tiq-part-1-how-to-destroy-your-power-bi-model-with-auto-date-time/ 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors