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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
asjones
Helper IV
Helper IV

Filter Slicer Based on Setup/Filters in a Line Chart

I have a line chart in Power BI that has the X by Fiscal Year.  I also have a filter on the chart limiting the range of the fiscal years (I have more years than needed for the chart).  On the same page is a slicer that shows Country (related table). There are countries listed in the slicer that are not in the table range. I tried using the examples of using DAX to hide slicer data that does not have a value and it hid a few things. However some of the Countries have data listed outside the date range in the line chart. So the slicer still shows them. This is making the country list slicer much larger than it should be.

 

Is there a way to filter the slicer based on the filters set in another visual? 

I also tried setting the fiscal year limits in the DAX slicer code, however the code for that did not seem to work (other tables for fiscal year etc…) In some ways this seemed like  the best idea. If I worked right I could apply the DAX Slicer filter to both the Slicer and the line chart (maybe??)

 

Thoughts and ideas?

 

Thanks

Alan

 

I had started with examples from here

https://www.sqlbi.com/articles/syncing-slicers-in-power-bi/

1 REPLY 1
MFelix
Super User
Super User

Hi @asjones .

 

Wihtou any data is difficult to give the exact answer but in this case you need to use a crossfilter function to get a measure that filters out the values you don't need, of course this depends on the data model you have.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.