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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Jitmondo
Helper III
Helper III

Display current year and next year data in one visual based on Year slicer selection.

Hi all

 

Not sure if this is possible,I have a line and stacked column chart that can be filtered by year individually and combined for 2021,2022, and 2023. It currently shows all years and months in the correct order when nothing is selected in the year slicer.

I want to be able to select a year and have my line and stacked column chart display that year and the next year figures. If I select 2021 on my year slicer, I want to only see 2021+2022 or if I select 2022 I want to see 2022+2023 only.

 

I am not sure if I should be trying a specific dax function or if this is just something thats not possible

 

 

Thanks 

 

 

1 ACCEPTED SOLUTION

Thanks jaideepnema will give this a go and let you know how I get on thanks!

View solution in original post

3 REPLIES 3
Jitmondo
Helper III
Helper III

Due to time restraint I ended up producing the view with a slider. Thanks for your advice I will look to try it out when I get a chance 🙂

jaideepnema
Solution Sage
Solution Sage

Hi @Jitmondo ,
There might be a better way of doing this. I tried to recreate your scenario with one fact table containing data and one date dimension table containing the date values. I removed the relationship between these tables in order to avoid filtering and create a following measure

 

Filter = 

var selectedyear=SELECTEDVALUE('Dim Date'[Date].[Year])

var filtercalc=IF(YEAR(SELECTEDVALUE('Data'[Date])) in {selectedyear,selectedyear+1},1,2)

return filtercalc
 
Now i used this measure in visual level filter and applied the filter 1 to take all records that the required filtering criteria on the graph(clustered column chart).
 
Please find attached the PBIX file for your reference. Let me know if this helps !!
 

Connect with me on LinkedIn: https://www.linkedin.com/in/jaideepnema/

 

Please accept this as a solution if your question has been answered !!

Appreciate a Kudos 😀

Thanks jaideepnema will give this a go and let you know how I get on thanks!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors