cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Filter a dimension table based on a measure

Hi,

 

The issue I am having is, I am not able to find a way to use a slicer to filter Branch Codes by a measure.

 

The measure is Sales Growth By Branch.  I have 100 branches in the dimension table. I made a slicer from a disconnected table having two values "Positive" and "Negative".  I should be able to filter the report and all its visuals based on the slicer selection. once I select "Above", all branches having positive sales growth should be filtered. 

 

I tried to create a calculated column based on the above measure and secondary column to evaluate "Above" or "Below" and use it as a slicer but the measure doesn't respect outside filters like dates. 

 

 

Appreciate your help 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Filter a dimension table based on a measure

Hi @Fowmy,

Please create a measure using the formula.

filter_measure =
IF (
    ISFILTERED ( Selection[Growth] ),
    IF (
        SELECTEDVALUE ( Selection[Growth] ) = "Negative"
            && Sales[Sales Growth] <= 0,
        1,
        0
    )
        + IF (
            SELECTEDVALUE ( Selection[Growth] ) = "Positive"
                && Sales[Sales Growth] > 0,
            1,
            0
        ),
    1
)


Then use it as a visual level page. The visual will I should filtered the report and all its visuals based on the slicer selection. When you select "Positive", all branches having positive sales growthwilled be filtered. 
  when select Positivewhen select Positive
when select Negeaivewhen select Negeaive
Notice, we can not add a measure as page level filter, so you need to the filted measure above as each visual in the page. Please down the attchment file for analysis.

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
Highlighted
Helper V
Helper V

Re: Filter a dimension table based on a measure

Hi,

 

I have attached a sample .pbix file to further understand the issue.

 

https://1drv.ms/u/s!AmoScH5srsIYt0qpDyOfvYeGXhcn

 

 

Thanks

Highlighted
Microsoft
Microsoft

Re: Filter a dimension table based on a measure

Hi @Fowmy,

Please create a measure using the formula.

filter_measure =
IF (
    ISFILTERED ( Selection[Growth] ),
    IF (
        SELECTEDVALUE ( Selection[Growth] ) = "Negative"
            && Sales[Sales Growth] <= 0,
        1,
        0
    )
        + IF (
            SELECTEDVALUE ( Selection[Growth] ) = "Positive"
                && Sales[Sales Growth] > 0,
            1,
            0
        ),
    1
)


Then use it as a visual level page. The visual will I should filtered the report and all its visuals based on the slicer selection. When you select "Positive", all branches having positive sales growthwilled be filtered. 
  when select Positivewhen select Positive
when select Negeaivewhen select Negeaive
Notice, we can not add a measure as page level filter, so you need to the filted measure above as each visual in the page. Please down the attchment file for analysis.

Best Regards,
Angelia

View solution in original post

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors