cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Fowmy Frequent Visitor
Frequent Visitor

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
v-huizhn-msft Super Contributor
Super Contributor

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. 
  2.PNGwhen select Positive
3.pngwhen 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

2 REPLIES 2
Fowmy Frequent Visitor
Frequent Visitor

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

v-huizhn-msft Super Contributor
Super Contributor

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. 
  2.PNGwhen select Positive
3.pngwhen 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