Forum Discussion

atul9063's avatar
atul9063
Helper III
7 years ago
Solved

OR Logic in single slicer values

Hi,

I have slicer (with values Churn1,Churn7,Churn28 and No Churn),

 

 

Selecting churn7 on slicer would filter the below table for Churn='Churn7' or Churn='Churn1' ,similarly on selecting churn28, filter would be Churn='Churn1' or Churn='Churn7' or Churn='Churn28' .

 

Dataset

 

TPID           Churn

1Churn1
2Churn7
3Churn1
4Churn28
5Churn7
6No Churn
  • Hi atul9063,

     

    There are some workarounds. But you should think again first. Because it's confusion. Please download the demo from the attachment.

    1. Add an ID column to the slicer table. 

    2. Don't establish any relationship.

    3. Create a measure.

    Measure =
    VAR slicer =
        SELECTEDVALUE ( Table1[CHURNAME] )
    VAR selected =
        CALCULATETABLE (
            VALUES ( Table1[CHURNAME] ),
            FILTER (
                ALL ( Table1 ),
                'Table1'[ID] <= MIN ( 'Table1'[ID] )
                    && Table1[ID] > 0
            )
        )
    RETURN
        IF (
            slicer = BLANK (),
            1,
            IF ( MIN ( Table2[Churn] ) IN selected, 1, BLANK () )
        )
    

    OR-Logic-in-single-slicer-values

     

    Best Regards,

1 Reply

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi atul9063,

     

    There are some workarounds. But you should think again first. Because it's confusion. Please download the demo from the attachment.

    1. Add an ID column to the slicer table. 

    2. Don't establish any relationship.

    3. Create a measure.

    Measure =
    VAR slicer =
        SELECTEDVALUE ( Table1[CHURNAME] )
    VAR selected =
        CALCULATETABLE (
            VALUES ( Table1[CHURNAME] ),
            FILTER (
                ALL ( Table1 ),
                'Table1'[ID] <= MIN ( 'Table1'[ID] )
                    && Table1[ID] > 0
            )
        )
    RETURN
        IF (
            slicer = BLANK (),
            1,
            IF ( MIN ( Table2[Churn] ) IN selected, 1, BLANK () )
        )
    

    OR-Logic-in-single-slicer-values

     

    Best Regards,