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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
suparnababu8
Resolver III
Resolver III

How to restrict Date Hierarchy up to current date in a Slicer.

Hi @community15 

I have date in my data model from 1st January 2024 to 15th April 2024. Based on this I created a Calender table. When I drag this date into a slicer and by right clicking on date in the filed and check to Date Hirearchy. It is showing full months ( Jan 2024 to Dec 2024) and date for the year of 2024. 

I need only upto current date with date hirearchy option.(Year- 2024, Months - Jan,Feb,March and April, Day - upto 15th of April)

If any help that would be great.

Thanks in advance!!
@Como @mFabric  @Mic  @Ejemplo  @AilleryO  @timalbers @v-jageo @v-yangliu-msft @Anonymous 


7 REPLIES 7
suparnababu8
Resolver III
Resolver III

Just a note: If am enabling Hirearchy it's not working. without Hirearchy it's okay.

timalbers
Responsive Resident
Responsive Resident

If you only want to have it filtered for the slicer visual, you could simply add a rule in the Filter Pane on the right side for this specific visual, to only include dates until today (relative time) or until 15.04. (absolute value)

If date will updated automatically for eaxample 20th Apr 2024. So, it'll be updated automatically?

As I said, this is up to your configuration. In the filter pane you can choose between something like "is before [an absolute date]" or a relative date span like "is in the last 4 months (inluding/excluding today)". This is all up to you.

It's fine. But I dont want hard code it. It should be dynamic. Need help.

Joe_Barry
Super User
Super User

Hi @suparnababu8 

 

Did you create you date table by using the Minx(Sales[Date]) and Maxx([Sales[Date]) ? This should only return the dates defined in the Sales Table

 

CALENDAR (MINX (Sales, [Date]), MAXX (Sales, [Date]))

Thanks

Joe

 

If you found my answer helpful and it solved your issue, please accept as solution




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


I tried. But, it's not working. It is showing entire months till DEC-2024.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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