cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Slicer with Date Hierarchy

@ptawil , 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")
)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Slicer with Date Hierarchy

@ptawil , 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")
)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Frequent Visitor

Re: Slicer with Date Hierarchy

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
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Don't miss the Power BI Dev Camp this week!

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Kudoed Authors