Forum Discussion

Fowmy's avatar
Fowmy
Icon for Super User rankSuper User
8 years ago
Solved

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 

  • 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 Positive
    when 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

    • v-huizhn-msft's avatar
      v-huizhn-msft
      Icon for Microsoft Employee rankMicrosoft Employee

      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 Positive
      when 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