Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Filter out only some rows

My data has a column with one of 3 values - say A, B & C.

I want a table that always displays rows with A or B and a slicer that selects whether C rows are displayed.

So:

     Slicer ticked: Display all data (A, B & C)

     Slicer unticked: Display only rows with A or B

Is this possible?

I'm currently using a simple slicer, but this allows the user to turn off A & B. Is there a way to lock certain values on?

  • Hi Anonymous ,

    You could try to create a new irrelated table as a slicer. I created a simple sample that you can reference.

    • Create a new table munally

    • Create a measure
    Measure = 
    var A_B = CALCULATE(SUM('Table 1'[Values]),FILTER('Table 1','Table 1'[Items] = "A" || 'Table 1'[Items] = "B"))
    var C = CALCULATE(SUM('Table 1'[Values]),FILTER('Table 1','Table 1'[Items] = "C"))
    return
    IF(ISFILTERED('Table'[Filter Table]),C,A_B)

     

    Best Regards,

    Xue Ding

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the response AndrejZitnay, but nothing in the suggested learning that I can find answers the question. A basic slicer doesn't do what I need because I want to display some rows regardless of the slicer selection.

      • v-xuding-msft's avatar
        v-xuding-msft
        Community Support

        Hi Anonymous ,

        You could try to create a new irrelated table as a slicer. I created a simple sample that you can reference.

        • Create a new table munally

        • Create a measure
        Measure = 
        var A_B = CALCULATE(SUM('Table 1'[Values]),FILTER('Table 1','Table 1'[Items] = "A" || 'Table 1'[Items] = "B"))
        var C = CALCULATE(SUM('Table 1'[Values]),FILTER('Table 1','Table 1'[Items] = "C"))
        return
        IF(ISFILTERED('Table'[Filter Table]),C,A_B)

         

        Best Regards,

        Xue Ding

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.