Forum Discussion

wojbal's avatar
wojbal
Frequent Visitor
4 years ago
Solved

Filter datasets if contains characters from different table

Hello,

 

I want to filter the datasets where the values is in combined columns and match one of the selected criteria from a different table.

I would like to present the data as follows show all rows from Table 1 from Group B and then filter them by Tags so for example show Group B and then select 3 to show rows that match that criteria. 

 

Table 1:

Unique IDPriceSales
1470,085561886
2580,556696382
3690,547403734
470,905611595
580,423741741
690,571299859
140,407967925
250,942387684
360,120741181
120,410226239
450,920902607
780,216168442
230,528822200
560,195476752
890,979695346
150,073693548
590,593816312
510,553349449
530,496685920
570,923219105


Table 2 with groups and tags

GroupsUniqe IDTAG#1TAG#2TAG#3TAG#4TAG#5TAG#6AllCombinedTags
Group A14712345 12345
Group B258678145 678145
Group C369678915 678915
Group A471214345121434
Group D58562121656212
Group A6912345 12345
Group E141617   1617
Group C2567810  67810
Group C3612318  12318
Group G121212   1212
Group F45121314   121314
Group C78678   678
Group H2361234 61234
Group C5656318 56318
Group C89111221013 111221013
Group C152351  2351
Group F591324568132456
Group C51122146551221465
Group C5367215 67215
Group B5768195 

68195

Table 3 with only unique groups, duplicates removed

Groups
Group A
Group B
Group C
Group D
Group E
Group G
Group F
Group H

 

Table 4 is unpivoted table 2 with Tags as value and columns Tag#1,2,3 etc as attributes but attributes were removed from the table

GroupsTags
Group A1
Group A2
Group A3
Group A4
Group A5
Group A12
Group A14
Group B6
Group B7
Group B2
Group B3
Group B5
Group B8
Group B14
Group B1
Group B9
Group C1
Group C2
Group C3
Group C18
Group C5
Group C6
Group C8
Group C7
Group C9
Group C15
Group C10
Group C11
Group C12
Group C13
Group C14
Group D5
Group D6
Group D2
Group D1
Group D16
Group E1
Group E6
Group E17
Group E2
Group F12
Group F13
Group F14
Group F2
Group F4
Group F5
Group F6
Group F8
Group G1
Group G2
Group H6
Group H1
Group H2
Group H3
Group H4

 

Thanks for the help,

Best

  • Hi wojbal ,

    According to your description, here's my solution.

    1.Create relationship between tables like this.

    2.Create a measure.

    Check =
    IF (
        SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#1] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#2] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#3] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#4] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#5] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#6] ),
        1,
        0
    )

    3.In the Table1 visual, put the measure in the visual filter and select its value to 1. Groups filter form Table3 and Tags filter from Table4.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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

1 Reply

  • Hi wojbal ,

    According to your description, here's my solution.

    1.Create relationship between tables like this.

    2.Create a measure.

    Check =
    IF (
        SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#1] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#2] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#3] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#4] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#5] )
            || SELECTEDVALUE ( 'Table 4'[Tags] ) = MAX ( 'Table 2'[TAG#6] ),
        1,
        0
    )

    3.In the Table1 visual, put the measure in the visual filter and select its value to 1. Groups filter form Table3 and Tags filter from Table4.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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