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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
spagad6263
Post Patron
Post Patron

Date Slicer default to previous month

Hi,

I have a Date slicer on a page, and would like to default the slicer selection to previous month. For instance, today is 29/09/2022, and I would like to Slicer default to Aug 2022. I've tried the filter on page, using relative month, but it gives 29/08/2022 to 28/09/2022. This is not really what I need. Btw, I use Dec 2021 edition, and I don't use my own Data table. Not sure how to use it yet. Any suggestions would be much appreciated!. Thanks

 

spagad6263_0-1664407801469.png

 

1 ACCEPTED SOLUTION
ribisht17
Super User
Super User

@spagad6263 

 

Please check this one https://community.powerbi.com/t5/Desktop/Slicer-default-to-previous-month/td-p/2058015

 

Thanks,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

View solution in original post

2 REPLIES 2
ribisht17
Super User
Super User

@spagad6263 

 

Please check this one https://community.powerbi.com/t5/Desktop/Slicer-default-to-previous-month/td-p/2058015

 

Thanks,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

AUDISU
Resolver III
Resolver III

@spagad6263 

Hi,

You have to create new column in calender table to check it is previous month or not. then add that column to month slicer.

Use following code.

 #"Added Custom" = Table.AddColumn(#"Changed Type", "Is Previous Month", each if Date.Month([Date]) = Date.Month(Date.AddMonths(DateTime.LocalNow(),-1)) then "Previous Month" else Date.MonthName([Date]))
in
#"Added Custom"

 

Thank you

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.