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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
DJims86
Frequent Visitor

Dynamic Year Filtering for Multiple Visuals Based on a Selected Year

Hello everyone,

I’m working on a Power BI dashboard where I have three instances of the same visualization, and I want each to display data for a different year based on a single slicer selection:

  • First visual → Displays the selected year.
  • Second visual → Displays the previous year.
  • Third visual → Displays the next year.

For example, if the user selects 2025, the visuals should show:

  • First visual: 2025
  • Second visual: 2024
  • Third visual: 2026

If the user selects 2018, they should display:

  • First visual: 2018
  • Second visual: 2017
  • Third visual: 2019

What I Have Tried So Far

  1. Created a disconnected table (YearSelection) for the slicer, containing distinct years.
  2. Created a measure to capture the selected year:
    SelectedYear = SELECTEDVALUE(YearSelection[Year])
  3. Created a measure to filter each visualization dynamically:
    ShowYearFilter = VAR SelectedYr = SELECTEDVALUE(YearSelection[Year]) RETURN IF( NOT ISBLANK(SelectedYr) && 'Enrollment_Model_Individual'[Year] IN { SelectedYr - 1, SelectedYr, SelectedYr + 1 }, 1, 0 )
  4. Applied the ShowYearFilter = 1 measure as a visual-level filter on each visual.

Issue I’m Facing

  • The matrix visuals only show the selected year, but the previous and next years remain blank.
  • I suspect it’s because SELECTEDVALUE(YearSelection[Year]) is filtering the dataset too aggressively, preventing non-selected years from appearing.

Question

How can I dynamically display the selected year, previous year, and next year across three separate visuals while keeping them responsive to the slicer?

Any suggestions or alternative approaches would be greatly appreciated! Thanks in advance.

 

DJims86_0-1740780672669.png

 

1 ACCEPTED SOLUTION

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Here's a way to do it without a disconnected table.  Hope this helps.

Ashish_Mathur_0-1741398321929.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Use WINDOW functions instead  (OFFSET, for your case)

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thanks for your reply and sorry for the delay in responding. I am attaching a .pbix file with sample data that illustrates my problem.

 

DynamicYearPBIX

lbendlin_0-1741392887148.png

 

Thank you so, so much. Huge help. I appreciate you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.