Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Team,
My report displaying published month in slicer. Next month automatically need to change, But not changing .
Could you please help me, How to set Slicer default selected value is Current month.
Thanks in advance for your help.
Regards,
Sriram e
Solved! Go to Solution.
Hi @Anonymous ,
I created two calculated columns like this.
Month = [Date].[Month]
Mark_Month =
IF(
[Date].[MonthNo] = MONTH( TODAY() ) && [Date].[Year] = YEAR( TODAY() ),
"Current month",
"Not current month"
)
And add the two calculated columns to the slicer visual.
Each time the dataset is refreshed, the current month in the dataset is marked, and the default value of the slicer is always the current month.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please refer to my .pbix.
Set the default value of the slicer to the current month. As the date column is updated, the default value of the slicer will always be the current month.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your response. Im unable to open your Power BI report. Getting error below error.
Hi @Anonymous ,
I created two calculated columns like this.
Month = [Date].[Month]
Mark_Month =
IF(
[Date].[MonthNo] = MONTH( TODAY() ) && [Date].[Year] = YEAR( TODAY() ),
"Current month",
"Not current month"
)
And add the two calculated columns to the slicer visual.
Each time the dataset is refreshed, the current month in the dataset is marked, and the default value of the slicer is always the current month.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @v-lionel-msft , I was able to use that.
In the hierarchy I noticed that the selected month name becomes unreadable while using the drop down view, so I adjusted your solution to the following:
Mark_Month =
IF(
[Date].[MonthNo] = MONTH( TODAY() ) && [Date].[Year] = YEAR( TODAY() ),
[Date].[MonthName], //the current Month Name istead of "Current month"
"Not current month"
)
and it looks like that:
BR, Roman
@Anonymous , In my Date table I create a month Name like this and select current month in Slicer
Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)
I also sort this on
Format([Date],"YYYYMM")
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
You can default value in slicer by function
@amitchandak Thanks for your response. I dont have Calender table. My Main table have Date column. Is it possible to use my Main table Date column. if not possible please let me know, How to create Calender table.
If you have any sample report, Please share.
Regards,
Sriram
@Anonymous , refer to my blog for a calendar of choice for financial years
Hi @Anonymous ,
Please check if this solution works for you. (pbix file is attached)
https://community.powerbi.com/t5/Desktop/Setting-the-Default-Value-of-a-Slicer/m-p/16442
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |