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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Filter line graph on maximum date

Hi,

 

I have this line graph and I want to show for 3 time perspective options:

- year

- quarter

- month

 

And then I want to filter on a maxium period and show x periods (until chosen period).

So eg.: show per month for 12 periods ending in October 2017

Or: show per quarter for 6 periods ending in Q1 2016.

 

I have a dataset with all values like this:

table structure.jpg

 

I can make a filter on time perspective. But how do I make sure to select an end period? and number of periods shown?

 

I tried to make all the periods integers (so 201710 for month and 201703 for quarter and 2017 for year) and make a slicer with those periods (so select between 201701 and 201710), but it's not the best solution.

What's the trick?

 

Thanks!

 

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

Is the "maxium period" based on "time perspective"? So, Year for 1, Quarter for 3, Month for 12?

 

I have seen requirement like selecting 1 year and returns 2 years data into visual. For that one, it requires a duplicated table with a flag column to tag if current row is within 2 years from selection. This is not a nice approach already. At least, the "2" (years) is static which still can be applied into calculated column logic. 

 

But in your scenario, each time perspective has different "number of periods". This is a dynamic context based on another dynamic selection. It's not possbile to dynamically get related "periods" when selecting time perspective in a filter or slicer. 

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

Is the "maxium period" based on "time perspective"? So, Year for 1, Quarter for 3, Month for 12?

 

I have seen requirement like selecting 1 year and returns 2 years data into visual. For that one, it requires a duplicated table with a flag column to tag if current row is within 2 years from selection. This is not a nice approach already. At least, the "2" (years) is static which still can be applied into calculated column logic. 

 

But in your scenario, each time perspective has different "number of periods". This is a dynamic context based on another dynamic selection. It's not possbile to dynamically get related "periods" when selecting time perspective in a filter or slicer. 

 

Regards,

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.

Top Solution Authors