The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a slicer on my visuals selecting the previous month, therefore excluding the current month.
Now, the problem occurs when the new year begins. As you can guess the slicer will select Demcember as the last month and the visual will stay on 2022.
What I've done is that I created a slicer that will always select the current year. Will this solve this problem, or is there anyhting else I need to do?
The code:
Latest Month =
if(
month(today()) -1 = month(Date_Table[Date]) ,
"Vorige maand",
Date_Table[Month Name]
And
Current Year =
IF(
'Date_Table'[This Year] = 'Date_Table'[Year],
"Huidig jaar",
FORMAT('Date_Table'[Year], "General Number")
)
@Solans , Based on what I got. It would better to have month year slicer like
Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1*month(Today())),"Last year Last Month" ,
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
eomonth([Date],0)= eomonth(Today(),-1*month(Today()) ),"Last Dec" ,
Format([Date],"MMM-YYYY")
)
Hi,
Thanks for your reply, however this doesnt seem to work as intended.
For reference, I am trying to use the slicer on two visuals that show the count of tickets.
The first visual has to show the count of tickets for 2 different departments and for every month of this year.
The second visual shows the count of total tickets of the current year (of completed months) in comparison with last year.
Now the problem I have is that when it is Januari, the month selected is then December, The visuals then show the data of 2022, and I have to manually update the year to the next.
Picture for reference: