Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Saye
Frequent Visitor

Default current Year

I have a table called Sales and Calender. 

When the year is selected from the slicer it should show the selected year values, if not should show the default current year. For example, if I select 2021, it should show us 2021. If I am not select any year from the slicer it should show me 2023 since 2023 is the current year.

3 REPLIES 3
Saye
Frequent Visitor

Thank you Anthony,
Here is the DAX quey.

 

Selected Year =

IF (

    ISFILTERED (Calender[date_id].[Year]),

    YEAR(DATE(MAX(Calender[date_id].[YEAR]),1, 1)),

    YEAR(TODAY())

)


I use this DAX, it was wroking fine but now its not working. Here is the screenshoot. 
When I select 2021 from the slicer, it shows me 2021 result.

 

When I am not select any year from the slicer, it shows me 2023 result.

 

So what should it be showing? 

AnthonyGenovese
Resolver III
Resolver III

That is not how slicers work. The closest way you can get to what you want is to change the slicer to either single select, or multi select and remove the select all option. If you go the multi select route, I usually enable the CTRL selection so people don't go crazy selecting and unselecting things. 

 

If you are looking to perform this functionality in Dax, you would need to provide a sample measure and I can help you write it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.