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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Bertje123456
Frequent Visitor

I want to add a slicer with last three years as option

Hi, 

 

I have a question about my Power BI dashboard. I built a report with information about current year YTD and previous year YTD. Now this is of course about the year 2025. However, there is no data yet because I only want data to be visible when the month is over. 

 

Now there is a demand from the business to be able to select the year themselves. I would like a slicer filter where they can select the year 2024 or 2023. So, I actually want the business to be able to make a choice about the last three years. 

 

So for example, deafult, I want to see current year YTD 2025 en previous year YTD 2024. In the slicer they can select for example 2024. Than current year YTD changes tot 2024 and previous year YTD changes to 2023. 

 

I made a slicer filter and added year. But the visual is not changing. 

 

How can I do this? 

 

DAX formula Current year YTD

CY YTD =
    CALCULATE(
    SUM('VW_F_NETVERLIES_VOLUMES'[Verbruik in kWh]),
    KEEPFILTERS('VW_D_DATUM_PERSISTANT'[Datum] <= EOMONTH(TODAY(), -1)),
    'VW_D_DATUM_PERSISTANT'[Jaar] = YEAR(TODAY())
)

 

DAX formula Previous year YTD

PY YTD =
    CALCULATE(
        SUM('VW_F_NETVERLIES_VOLUMES'[Verbruik in kWh]),
        KEEPFILTERS('VW_D_DATUM_PERSISTANT'[Datum] <= EOMONTH(TODAY(), -1)),
    'VW_D_DATUM_PERSISTANT'[Jaar] = YEAR(TODAY())-1
)
 
Bertje123456_0-1736431770598.pngBertje123456_1-1736431787556.png

 

 

1 REPLY 1
lbendlin
Super User
Super User

Teach your users how to use the filter pane. There they can apply a relative date filter, including "last three years"

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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