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
Anonymous
Not applicable

Slicer with Date Hierarchy

Hello,

 

I have a table with 2 months worth of Date data, and when i use it as a slicer it shows all months of the year. Even weirder, if I add another column for slicer (like category/sex etc...) in my slicer it will only display the two correct months. Unfortunately, I do not want to slice it by 2 categories so I am stuck with this bloated slicer.

 

Other question while I'm at it, is there a way to specify a default value for the slicer instead of having every value selected by default?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , No, if you want to function based. Static Value yes.

 

We create this type of column in date table to always select this month

Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , No, if you want to function based. Static Value yes.

 

We create this type of column in date table to always select this month

Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

Anonymous
Not applicable

Ideally I wanted to use hierarchy so I could not get a bloated list for each year i keep adding to this dashboard.

 

But for now that works.

 

Thanks.

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.