Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to display the date for the last closed month in my Power Bi report as a slicer.
For example, If I am in the month of May 2022, I want to select April 2022 as a default value in my slicer
If I am looking at my report in the month of June 2022, then May 2022 should be selected as a default value in my slicer.
Note: This selection should be dynamic.
Data for that slicer is coming from a Calendar[MonthYear] which has dates from Jan 2022 till Dec 2022
Not sure, but we might need to write a dax that can compare the date is closed or not, If not closed then show Today()-1 in the
format of MMM YYYY
@amikm , you have use workaround, Create a column like this and use that in slicer and save with last month
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)
@amitchandak , thanks for your reply, After implementing the same, I am getting like this
If user wants to see for other months then how he can do this , as Slicer is only showing one value, and I don't want the user to clear the values from filter section
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |