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
g_hill
Frequent Visitor

How can I filter a chart to show full quarters?

Hello, I want to be able to filter a chart to show the last 9 fiscal quarters so we can compare the current quarter with the the same quarter in the past two years. The filter pane doesn't allow quarterly and if I do monthly then it's always cutting off part of the quarter furthest in the past. In the example below the filter is missing Jan and Feb 2022 of Q4 2021/22
 

g_hill_0-1711557937117.png

 

Is there a way to add a dynamic filter so I don't need to do in and update the filter every quarter?

 

1 ACCEPTED SOLUTION

I've managed to get it working with a silghtly edited version of your code:

Display Data = if([Year]>=(Year(TODAY())-1),"Display",if(and(Quarter([Date])>=Quarter(today()),[Year]>=(Year(TODAY())-2)), "Display", "Do Not Display"))

Thanks

View solution in original post

4 REPLIES 4
kaylastarr
Advocate V
Advocate V

Hello, 

 

You can add a slicer to the page and inclued in the slicer the "Date Prevention" Heirarchy. Then you can just select the years and quarters you would like displayed.

kaylastarr_0-1711558535798.png

 



Hi Kaylastarr, I've done that as a temporary solution but it still involves me going into the desktop file and changing the slicer every quarter. I want to avoid that.

If you want a more complicated method you can add a calulated column to your table to check if the data should be displayed and then filter it by that.

Something like.

Display Data = if(Year(date)>=(Year(today())-1),"Display",If(and(Quarter(date)>=Quarter(today()),Year(date)>=(year(today())-2), "Display", "Do Not Display")

You may have to adjust it a bit depending on which exact quarters you want to display buts thats the jist.

I've managed to get it working with a silghtly edited version of your code:

Display Data = if([Year]>=(Year(TODAY())-1),"Display",if(and(Quarter([Date])>=Quarter(today()),[Year]>=(Year(TODAY())-2)), "Display", "Do Not Display"))

Thanks

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.