Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi, is it possible to have a month slicer (January up to December) to have preselected all active current year months based for example with last date or max date functions.
For example if Max Date is October 1st 2021, Month Slicer should have preselected January up to October, leaving November and December unselected.
Thanks very much.
HI datahub
Please consider this solution and click then thumbs up just for me taking the effort to help.
Also click ACCEPT SOLUTION if it fixes your pronlems.
Create a Calendar table 01Jan21 to 21Dec21.
Then in Power Query use the Calendar table to create a pick list with
Period / Date / Sortseq
Jan 01Jan21 1
Jan 02Jan21 1
Jan 03Jan21 1
etc etc etc
Feb 01Feb21 2
Feb 02Feb21 2
Feb 03Feb21 2
etc etc etc
Dec 29Dec21 12
Dec 30Dec21 12
Dec 31Dec21 12
YTD 01Jan21 -1
YTD 02Jan21 -1
YTD 03Jan21 -1
etc to
YTD 15Oct21 -1
MTD 01Oct21 -2
MTD 02Oct21 -2
MTD 03Oct21 -2
etc to
MTD 15Oct21 -2
Then build a relationship between the picklist date and the calendar date and relate any fact tables to the calendar date.
Set the Picklist period sort to the Sortseq
When you add the picklist period to the slicer it will show
MTD, YTD, Jan, Feb, Mar, May, etc in the correct sequence.
When the user selects YTD then the relationship will filter just the required dates.
There are lot of examples on Youtube how to do this.
@datahub , Function base selection is not supported yet, You can vote for an idea or log a new one -https://ideas.powerbi.com/ideas/
The work around as of now is in Date table have a new column
Month Type = Switch( True(),
eomonth([Date],0) <= eomonth(Today(),0) && year([Date]) = Year(Today()),"Active Months" ,
Format([Date],"MMM-YYYY")
)
and use that
Hi @amitchandak Thanks, tried solution, close but is there the possibility to have the current year active months all selected (checked) on the slicer and leave November and December unselected (unchecked) but still present in the slicer (this is because fact table has other past years with data as well) So end user could select them as well to analize other years as well.
Data will be refreshed every month, so idea is to always autoselect (autocheck) only current year´s months with data available.
Here is a screenshot with the desired solution (next month, November should appear checked as well when data is refreshed)
Thanks.
HI @datahub,
AFAIK, current power bi does not include any features to dynamic active specific items in the slicer based on conditions.
For your requirement, you can add a calculated column to your table to check records based on conditions and remark tags. Then you can use this field on the report page to filter specific items. (they will not activate the slicer items, but the filter effect will be applied to the records)
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |