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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
PowerWhy
Helper IV
Helper IV

Changing filter context dynamically when cross-filtering visualisations

Hello,

I have the pbix file below which shows actuals and forecast accross 3 years, the slicer is used to select the year. I have actuals up to period 11 of the 2nd year.

When the user selects a year with at least 1 month but less than 12 months of actuals, I have been asked to show the last 12 months. Otherwise the graph should show the 12 months of the selected fiscal year.

https://www.dropbox.com/s/oxnni8837m3n6b8/Mockup%20-%20slicer%20different%20treatments%20-%202022%20...

Currently 2022 shows:
2022 - current.PNG

But it should show:
2022 - should be.PNG

And 2021 should stay unchanged as:

2021.PNG


And 2023 should stay unchanged as (it shows 12 months of forecast because there are no actuals):
2023.PNG

I guess I'm asking if it's possible to change the filter context of the axis labels, but I'm not sure it is?? (I was wondering if using bookmarks instead of a slicer, and filtering the visualisations by a measure might work, but can't quite see how to do it)

Many thanks for any pointers,

PW

2 REPLIES 2
PowerWhy
Helper IV
Helper IV

Hi @amitchandak sorry I'm not following - are you sure that changes the axes of the graphs? (not just changes the values of the data points?)

amitchandak
Super User
Super User

@PowerWhy , You need an independent date table

 

example

//Date1 is independent Date table, Date is joined with Table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])

var _max = if(Year(_max1) = Year(Today()) , eomonth(_max1 ,-1) ,_max1 )
var _min = eomonth(_max, -12) +1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.