Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I have a slicer which is based on the fiscal Year (field) of a table named 'Calendar'. Therefore, the slicer shows values, let's say from 1970 until 2025.
As I am interested only having the current year and the year before, I must go into the slicer filter and select only 2018 and 2019.
It works and that fine.
But in the key measure, I am able to define the current year as follow:
CurrentYear = Year(NOW())
The starting year become equal to the currentYear minus one.
I also can define in Key measure the variable StartingYear = CurrentYear - 1.
However, I don't know how I can use those two variables with a dynamic filter in order to allow the year slicer to show only the current year and the year automatically. So, in 2020 and after, I won't have to update the information on the filter. It will do it alone.
Does someone know how to do that&?
Tanks in advance for help
Solved! Go to Solution.
Hi @Anonymous ,
In my opinion, you can write calculated column/measure to check date range based on today function.
Then you can drag it to page level filter to control which records displayed in slicer.(slicer not support to add visual level filter)
Sample:
Tag =
IF (
YEAR ( Table[Date] )
IN { YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) },
"Y",
"N"
)
In addition, you can also try add additional date slicer with 'relative slicer' mode and year field to choose last 2 year records.
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
In my opinion, you can write calculated column/measure to check date range based on today function.
Then you can drag it to page level filter to control which records displayed in slicer.(slicer not support to add visual level filter)
Sample:
Tag =
IF (
YEAR ( Table[Date] )
IN { YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) },
"Y",
"N"
)
In addition, you can also try add additional date slicer with 'relative slicer' mode and year field to choose last 2 year records.
Regards,
Xiaoxin Sheng
Hello,
I have made some tests with the relative slicers but it did not work with my table.
Here's the solutions I have implemented based on your first solution.
Thanks a lot for your help.
alepage
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |