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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Cortana
Helper IV
Helper IV

I want to show specific year ranges (start year to end year) by using single value slicer

Hello,
I hope you all are doing good. I have imported a year table, that has a year column starting from 2023 to 2123 and an index column.

In power bi, I created a numeric range parameter slicer for start year. And I have created a dax measure for the end year. If you check the pbi file I attached then you will understand. The end year is basically, we are gonna consider the largest term among the 3 terms (wifia term, revenue term, and srf term) and the add the number with the starting year then we will get the end year.

 

But, what I need is to make a table visual with dynamic year column that will be responsive for start year measure and end year measure. Suppose, start year is 2037 and end year is 2065, then in that visual I want it to show years from 2037 to 2065. 

Please check the pbi file attached.

1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @Cortana ,

 

Based on your description,
Please try the following steps:
1.You can create a Calcualted table.

Table = VALUES('_YEAR'[Year])

There is no relationship between the two tables.

vweiyan1msft_0-1706755021736.png

2. Use the following code to create a Measure.

Measure = 
VAR sel_Year = SELECTEDVALUE('Table'[Year])
RETURN
IF(sel_Year >= [STARTYEAR] && sel_Year <= [ENDYEAR],
   1,
   0)

3. Put the Year field from Table into table visual.
Then select your visual object, put the measure in the “Filters on this visual" section, and filter it by “Measure is 1" ->Apply Filter.

vweiyan1msft_1-1706755063878.png

Result is as below.

vweiyan1msft_2-1706755084845.png

 

Best Regards,
Yulia Yan

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Cortana
Helper IV
Helper IV

OMG! That is so amazing, thanks a ton. @v-weiyan1-msft 

v-weiyan1-msft
Community Support
Community Support

Hi @Cortana ,

 

Based on your description,
Please try the following steps:
1.You can create a Calcualted table.

Table = VALUES('_YEAR'[Year])

There is no relationship between the two tables.

vweiyan1msft_0-1706755021736.png

2. Use the following code to create a Measure.

Measure = 
VAR sel_Year = SELECTEDVALUE('Table'[Year])
RETURN
IF(sel_Year >= [STARTYEAR] && sel_Year <= [ENDYEAR],
   1,
   0)

3. Put the Year field from Table into table visual.
Then select your visual object, put the measure in the “Filters on this visual" section, and filter it by “Measure is 1" ->Apply Filter.

vweiyan1msft_1-1706755063878.png

Result is as below.

vweiyan1msft_2-1706755084845.png

 

Best Regards,
Yulia Yan

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Cortana
Helper IV
Helper IV

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.