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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.