Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello, is there a way that the Power BI slicer will set or select the current year when data changes for the current year?
As of now, my data is only 2023, but soon it will be 2024. However, when I paste the data for 2024, I have to select the slicer and set it to 2024. Is there a way that Power BI will autodetect that there's a New Data for 2024 and set its slicer to 2024?
so when new data for 2024, this slicer should be 2024.
Solved! Go to Solution.
@dboi , One of the option is that, you use preselected slicer
Or you can have this column in you date table and deafult on this year
Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
Hi @dboi ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
1.Create calculate columns
Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])
Day = DAY('Table'[Date])
IsCurrentYear = IF(YEAR('Table'[Date]) = YEAR(NOW()), "Current", "Not Current")
2.Create a slicer use Year, Month, Day and apply IsCurrentYear as the filter of the slicer
Because filters cannot act directly on slicers with hierarchical filed values, so we need to create columns contain Year, Month and Day. When we create the visual object above, the slicer is empty because it is the year 2024 and the original data does not exist for the year 2024.
When we add 2024 data to the data, slicer shows the option to display the data now
Best regards
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @dboi ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
1.Create calculate columns
Year = YEAR('Table'[Date])
Month = MONTH('Table'[Date])
Day = DAY('Table'[Date])
IsCurrentYear = IF(YEAR('Table'[Date]) = YEAR(NOW()), "Current", "Not Current")
2.Create a slicer use Year, Month, Day and apply IsCurrentYear as the filter of the slicer
Because filters cannot act directly on slicers with hierarchical filed values, so we need to create columns contain Year, Month and Day. When we create the visual object above, the slicer is empty because it is the year 2024 and the original data does not exist for the year 2024.
When we add 2024 data to the data, slicer shows the option to display the data now
Best regards
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@dboi , One of the option is that, you use preselected slicer
Or you can have this column in you date table and deafult on this year
Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
92 | |
75 | |
65 | |
49 | |
36 |
User | Count |
---|---|
114 | |
89 | |
80 | |
60 | |
40 |