Forum Discussion
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 ID | Price | Sales |
| 147 | 0,085561 | 886 |
| 258 | 0,556696 | 382 |
| 369 | 0,547403 | 734 |
| 47 | 0,905611 | 595 |
| 58 | 0,423741 | 741 |
| 69 | 0,571299 | 859 |
| 14 | 0,407967 | 925 |
| 25 | 0,942387 | 684 |
| 36 | 0,120741 | 181 |
| 12 | 0,410226 | 239 |
| 45 | 0,920902 | 607 |
| 78 | 0,216168 | 442 |
| 23 | 0,528822 | 200 |
| 56 | 0,195476 | 752 |
| 89 | 0,979695 | 346 |
| 15 | 0,073693 | 548 |
| 59 | 0,593816 | 312 |
| 51 | 0,553349 | 449 |
| 53 | 0,496685 | 920 |
| 57 | 0,923219 | 105 |
Table 2 with groups and tags
| Groups | Uniqe ID | TAG#1 | TAG#2 | TAG#3 | TAG#4 | TAG#5 | TAG#6 | AllCombinedTags |
| Group A | 147 | 1 | 2 | 3 | 4 | 5 | 12345 | |
| Group B | 258 | 6 | 7 | 8 | 14 | 5 | 678145 | |
| Group C | 369 | 6 | 7 | 8 | 9 | 15 | 678915 | |
| Group A | 47 | 1 | 2 | 14 | 3 | 4 | 5 | 121434 |
| Group D | 58 | 5 | 6 | 2 | 1 | 2 | 16 | 56212 |
| Group A | 69 | 1 | 2 | 3 | 4 | 5 | 12345 | |
| Group E | 14 | 1 | 6 | 17 | 1617 | |||
| Group C | 25 | 6 | 7 | 8 | 10 | 67810 | ||
| Group C | 36 | 1 | 2 | 3 | 18 | 12318 | ||
| Group G | 12 | 12 | 1 | 2 | 1212 | |||
| Group F | 45 | 12 | 13 | 14 | 121314 | |||
| Group C | 78 | 6 | 7 | 8 | 678 | |||
| Group H | 23 | 6 | 1 | 2 | 3 | 4 | 61234 | |
| Group C | 56 | 5 | 6 | 3 | 1 | 8 | 56318 | |
| Group C | 89 | 11 | 12 | 2 | 10 | 13 | 111221013 | |
| Group C | 15 | 2 | 3 | 5 | 1 | 2351 | ||
| Group F | 59 | 13 | 2 | 4 | 5 | 6 | 8 | 132456 |
| Group C | 51 | 12 | 2 | 14 | 6 | 5 | 5 | 1221465 |
| Group C | 53 | 6 | 7 | 2 | 1 | 5 | 67215 | |
| Group B | 57 | 6 | 8 | 1 | 9 | 5 | 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
| Groups | Tags |
| Group A | 1 |
| Group A | 2 |
| Group A | 3 |
| Group A | 4 |
| Group A | 5 |
| Group A | 12 |
| Group A | 14 |
| Group B | 6 |
| Group B | 7 |
| Group B | 2 |
| Group B | 3 |
| Group B | 5 |
| Group B | 8 |
| Group B | 14 |
| Group B | 1 |
| Group B | 9 |
| Group C | 1 |
| Group C | 2 |
| Group C | 3 |
| Group C | 18 |
| Group C | 5 |
| Group C | 6 |
| Group C | 8 |
| Group C | 7 |
| Group C | 9 |
| Group C | 15 |
| Group C | 10 |
| Group C | 11 |
| Group C | 12 |
| Group C | 13 |
| Group C | 14 |
| Group D | 5 |
| Group D | 6 |
| Group D | 2 |
| Group D | 1 |
| Group D | 16 |
| Group E | 1 |
| Group E | 6 |
| Group E | 17 |
| Group E | 2 |
| Group F | 12 |
| Group F | 13 |
| Group F | 14 |
| Group F | 2 |
| Group F | 4 |
| Group F | 5 |
| Group F | 6 |
| Group F | 8 |
| Group G | 1 |
| Group G | 2 |
| Group H | 6 |
| Group H | 1 |
| Group H | 2 |
| Group H | 3 |
| Group H | 4 |
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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yanjiang-msft
Community Support
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 _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.