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
csaethre19
Helper II
Helper II

Dynamically filter measure based on slicer value

I am trying to create a measure that will be affected by a slicer that is selected. 

I have two measures that need to be affected by different slicer filters on one page, hence why I am not just synching all of these filters to this page. 

I need to dynamically filter this measure in a dax expression. 

 

My fact table is called 'public failure' and the dim table that the slicer is based on is 'public consumableVersion' which has a relationship to a table called 'public consumable' that has the relationship to 'public failure' through the consumable id. 

 

I currently have this:

 

Total Runs =
CALCULATE(
    DISTINCTCOUNT('public failure'[experimentId]),
    USERELATIONSHIP('public failure'[consumableId], 'public consumable'[id]),
    FILTER(
        'public failure',
        'public failure'[consumableId] IN VALUES('public consumable'[id])
    )
)
Where I just need to get distinct counts of experiment ids (to calculate total runs) but have the fact table filtered for the consumable versions that the user has selected from the slicer that lives on another page. 
 
Currently this dax expression does not filter my total runs measure when a consumable version is set. Is there something I am missing?
1 ACCEPTED SOLUTION

For the measure which needs to ignore 2 of the slicers you can use REMOVEFILTERS to ignore filters on the particular table or column used in the slicers.

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Slicers only affect the page that they are on. If you need a slicer to affect multiple pages you will need to duplicate the slicer on each page, make sure that it is set to sync. You can set it to hidden so that it doesn't affect the pages visually.

Once you have that set up, I don't think you would need the FILTER function in your code.

That is what I was doing before. However, I have two measures that need to be used in a visual. One of which needs to be affected by 6 of the 8 slicers I have. The other measure needs to be affected by all 8 slicers. Does that make more sense?

For the measure which needs to ignore 2 of the slicers you can use REMOVEFILTERS to ignore filters on the particular table or column used in the slicers.

Thank you this works for me!

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.