Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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" ...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |