Forum Discussion

Vishwamber's avatar
Vishwamber
Frequent Visitor
2 years ago
Solved

Slicer for multi cell value

I have excell sheet which has multiple columns, one column is having csv value, That I needed to use for slicer.

For an eg .

Sr NoTC IDResuly 
1TC95524 r1
2TC269975 r2,r4,r5,r6
3TC206228Passr2,r4,r6,r1
4TC206230Failr2,r4,r6,r2
5TC206242Passr2,r4,r6,r3
6TC206243Passr2,r4,r6,r4
7TC206244Passr2,r4,r6,r5
8TC206245Passr2,r4,r6,r6
9TC206246Passr2,r4,r6,r7
10TC207576Passr2,r4,r6,r8
11TC207577Failr2,r4,r6,r9
12TC207578Passr2,r4,r6,r10
13TC207579Passr2,r4,r6,r11
14TC207581Passr2,r4,r6,r12
15TC207582No resultr2,r4,r6,r13
16TC207583Passr2,r4,r6,r14
17TC207584Passr2,r4,r6,r15
18TC207585Passr2,r4,r6,r16
19TC207586Passr2,r4,r6,r17
20TC207587Passr2,r4,r6,r18
21TC207588Passr2,r4,r24
22TC207589Failr7

 

  

  • Hi Vishwamber ,

     

    Based on the sample and description you provided, Please try the following steps:
    My Sample:

    1.You can create a calcualted table.

    Table 2 = 
    DATATABLE (
        "Value", STRING,
        "Index", INTEGER,
        {
            { "r1", 1 },
            { "r2", 2 },
            { "r3", 3 },
            { "r4", 4 },
            { "r5", 5 },
            { "r6", 6 },
            { "r7", 7 },
            { "r8", 8 },
            { "r9", 9 },
            { "r10", 10 },
            { "r11", 11 },
            { "r12", 12 },
            { "r13", 13 },
            { "r14", 14 },
            { "r15", 15 },
            { "r16", 16 },
            { "r17", 17 },
            { "r18", 18 },
            { "r19", 19 },
            { "r20", 20 },
            { "r21", 21 },
            { "r22", 22 },
            { "r23", 23 },
            { "r24", 24 }
        }
    )
    

    2. Use the following code to create a measure.

    Contains_r = 
    VAR Within_text =
        SELECTEDVALUE ( 'Table'[y] ) & ","
    VAR Find_text =
        SELECTEDVALUE ( 'Table 2'[Value], BLANK () ) & ","
    RETURN
        IF ( CONTAINSSTRING ( Within_text, Find_text ), 1, 0 )
    

    3. Select your visual object, put the measure in the "Filters on this visual" section, and filter it by "Measure is 1".

    The field of the slicer is from Table 2. When you select "r1" in the slicer, Result is as below.

    Is this the result you expect?
    For further detail, please find attachment.


    Best Regards,
    Yulia Yan


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

3 Replies

  • Hi Vishwamber 
    Could you please demonstrate what you mean by 'CSV value'? By default, any column can be used as a slicer, so the question is not entirely clear.

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

     

  • Vishwamber's avatar
    Vishwamber
    Frequent Visitor

    I have updated table, I want to create filter which has unique value r1 to r24, if I slect select r1 it should filter row containing r1.

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

    Hi Vishwamber ,

     

    Based on the sample and description you provided, Please try the following steps:
    My Sample:

    1.You can create a calcualted table.

    Table 2 = 
    DATATABLE (
        "Value", STRING,
        "Index", INTEGER,
        {
            { "r1", 1 },
            { "r2", 2 },
            { "r3", 3 },
            { "r4", 4 },
            { "r5", 5 },
            { "r6", 6 },
            { "r7", 7 },
            { "r8", 8 },
            { "r9", 9 },
            { "r10", 10 },
            { "r11", 11 },
            { "r12", 12 },
            { "r13", 13 },
            { "r14", 14 },
            { "r15", 15 },
            { "r16", 16 },
            { "r17", 17 },
            { "r18", 18 },
            { "r19", 19 },
            { "r20", 20 },
            { "r21", 21 },
            { "r22", 22 },
            { "r23", 23 },
            { "r24", 24 }
        }
    )
    

    2. Use the following code to create a measure.

    Contains_r = 
    VAR Within_text =
        SELECTEDVALUE ( 'Table'[y] ) & ","
    VAR Find_text =
        SELECTEDVALUE ( 'Table 2'[Value], BLANK () ) & ","
    RETURN
        IF ( CONTAINSSTRING ( Within_text, Find_text ), 1, 0 )
    

    3. Select your visual object, put the measure in the "Filters on this visual" section, and filter it by "Measure is 1".

    The field of the slicer is from Table 2. When you select "r1" in the slicer, Result is as below.

    Is this the result you expect?
    For further detail, please find attachment.


    Best Regards,
    Yulia Yan


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