Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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
Is there a way to add a dynamic filter so I don't need to do in and update the filter every quarter?
Solved! Go to 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
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.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
77 | |
73 | |
58 | |
35 | |
31 |
User | Count |
---|---|
99 | |
57 | |
56 | |
46 | |
40 |