The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have created a report where it has a slicer Reporting Period, period updates every month with current month.
Is there any way that changes default selection value based on current month because right now the slicer selection stays just like it was in the moment where it was saved and published.
Solved! Go to Solution.
@magji Right, so the "something else" is whatever you want, so for example:
Column =
VAR __Year = YEAR(TODAY())
VAR __Month = MONTH(TODAY())
VAR __Date = [Date]
RETURN
IF(YEAR(__Date) = __Year && MONTH(__Date) = __Month,"Current Month",FORMAT(__Date,"mmmm") & YEAR(__Date))
So, this will return "Current Month", "August 2020", "July 2020" ...
@magji Not great way of doing it. You can use a relative date slicer. Or you can create a "flag" column that evaluates to "Current Month" and "Something else" for example and then you set "Current Month" in a slicer based on this column.
@Greg_Deckler
Thank you, but the user must be still able to select the previous months.
When the user opens the report in Power Bi they want the slicer automatically be selected in current month.
@magji Right, so the "something else" is whatever you want, so for example:
Column =
VAR __Year = YEAR(TODAY())
VAR __Month = MONTH(TODAY())
VAR __Date = [Date]
RETURN
IF(YEAR(__Date) = __Year && MONTH(__Date) = __Month,"Current Month",FORMAT(__Date,"mmmm") & YEAR(__Date))
So, this will return "Current Month", "August 2020", "July 2020" ...
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
246 | |
119 | |
114 | |
86 | |
70 |