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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.