<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Multicolumn Filtering via typescript searchbar. in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2567322#M36593</link>
    <description>&lt;P&gt;I found a way of doing it and will post the code on github. While it doesn't filter two columns at once it does allow me to filter based on the highest potential quantity of matches for the string of text against all column (so far just Int and string but this has worked for dates and hybrid text [v123]).&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 18:42:11 GMT</pubDate>
    <dc:creator>Merxvell</dc:creator>
    <dc:date>2022-06-08T18:42:11Z</dc:date>
    <item>
      <title>Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2541904#M36358</link>
      <description>&lt;P&gt;Edits:&lt;/P&gt;&lt;P&gt;Is there a way to see how something would filter prior to actually filtering the object?&lt;BR /&gt;If I'm able to do that then I can make it a logic where if blank / no values go to the next item to check.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original Post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi right now I'm submitting the following search query via typescript utilizing the ITupleFilter action (which may be incorrect? not sure) in order to try and do one of two things...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Find things that match in both columns of the data (EX: column: street value: 1234 lane .... column: zip value: 12345)&lt;/LI&gt;&lt;LI&gt;Find data that matches in one column of the data provided to the search bar (ex only 1234 lane appears and there's no zip code that starts with 1 in the dataset.)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Right now I'm gathering the data I need (column and table values) via the following loops&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//This is in the public update(options: VisualUpdateOptions)function
const array = []
    options.dataViews[0].metadata.columns.forEach(element =&amp;gt; {
      array.push(element)
    });

    this.myArray = array


// This portion is in a public performSearch(text: string) function
let testTarget: ITupleFilterTarget = []

this.myArray.forEach(element =&amp;gt; {
      if (element) {
        testTarget.push({
          table: element.queryName.substr(0, element.queryName.indexOf(".")),
          column: element.queryName.substr(element.queryName.indexOf(".") + 1)
        })
      }
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and putting it into a tuplefilter as such.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const isBlank = ((text || "") + "").match(/^\s*$/);
    let filter: ITupleFilter = null;
    let action = FilterAction.remove;
    if (!isBlank) {
      filter = {
        $schema: "https://powerbi.com/product/schema#Tuple",
        filterType: 6, //wtf??? FilterType.Tuple?? if this **bleep** works idfk man just.... https://community.powerbi.com/t5/Custom-Visuals-Development/Custom-Search-Visual/m-p/663749
        operator: "In",
        target: testTarget,
        values: [[{value: text}]]
      }
      console.log("filter")
      console.log(filter)
      action = FilterAction.merge;

    }

    
    this.host.applyJsonFilter(filter, "general", "filter", action)

    this.searchBox.property("value", text);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-right"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm noticing that if I have two data fields I can search the first but not the second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also there isn't a way to do this the "contains" operator is there?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Base of the code was provided from this repository&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-visuals-TextFilter/blob/master/src/visual.ts" target="_blank" rel="noopener"&gt;https://github.com/microsoft/PowerBI-visuals-TextFilter/blob/master/src/visual.ts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 16:01:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2541904#M36358</guid>
      <dc:creator>Merxvell</dc:creator>
      <dc:date>2022-05-27T16:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2548836#M36429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/394485"&gt;@Merxvell&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Do you want to filter data from multiple fields at a time? Generally, a custom visual like &lt;A href="https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa104381309?tab=overview" target="_self"&gt;Text Filter&lt;/A&gt; can &lt;STRONG&gt;only &lt;/STRONG&gt;filter one field. Please check the link below to see if it can be an alternative solution to achieve your needs.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1. Create a calculated table and measure:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/How-to-filter-on-multiple-columns/m-p/380232" target="_self"&gt;How to filter on multiple columns (check the post from&amp;nbsp;&lt;/A&gt;&lt;A class="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/9309" target="_self" aria-label="View Profile of Vvelarde"&gt;&lt;SPAN class=""&gt;Vvelarde&amp;nbsp;)&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;2. Create &lt;A href="https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380820?tab=Overview" target="_self" rel="nofollow noopener noreferrer"&gt;hierarchy slicer:&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Create-filter-from-two-columns/m-p/558582" target="_self"&gt;&lt;SPAN&gt;Create filter from two columns&lt;/SPAN&gt;&lt;/A&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yingyinr_0-1653965418244.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/724027iCC8F6BDCEF5D8150/image-size/large?v=v2&amp;amp;px=999" role="button" title="yingyinr_0-1653965418244.png" alt="yingyinr_0-1653965418244.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.enjoysharepoint.com/power-bi-slicer-multiple-columns/" target="_self"&gt;&lt;SPAN&gt;Power bi slicer multiple columns with examples&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 02:53:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2548836#M36429</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-31T02:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2552844#M36458</link>
      <description>&lt;P&gt;My wording was pretty trash after re-reading it. Ideally I'd like something like this in terms of step order (which I think I'm getting close to?)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;search column A based on the text field&lt;/LI&gt;&lt;LI&gt;if filter shows not / there is a matching value, grab results&lt;/LI&gt;&lt;LI&gt;Else, search column B based on the text field&lt;/LI&gt;&lt;LI&gt;repeat&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I realized a tuplefilter was not what I needed but rather Advance filter. I'm close I just need to know how to see if the filter would return empty.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 12:38:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2552844#M36458</guid>
      <dc:creator>Merxvell</dc:creator>
      <dc:date>2022-06-01T12:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2567322#M36593</link>
      <description>&lt;P&gt;I found a way of doing it and will post the code on github. While it doesn't filter two columns at once it does allow me to filter based on the highest potential quantity of matches for the string of text against all column (so far just Int and string but this has worked for dates and hybrid text [v123]).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 18:42:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2567322#M36593</guid>
      <dc:creator>Merxvell</dc:creator>
      <dc:date>2022-06-08T18:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2593198#M36874</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/394485"&gt;@Merxvell&lt;/a&gt;, I am having the same filtering issue. Could you possibly share your github repository so I can see your approach?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 20:31:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2593198#M36874</guid>
      <dc:creator>Ledia</dc:creator>
      <dc:date>2022-06-21T20:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multicolumn Filtering via typescript searchbar.</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2593252#M36876</link>
      <description>&lt;P&gt;Sure thing, haven't figured out how to approach trying to get this merged into microsofts main branch.&lt;/P&gt;&lt;P&gt;Please let me know if you find any bugs.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/gmmeyers/PowerBI-visuals-TextFilter" target="_blank" rel="noopener"&gt;https://github.com/gmmeyers/PowerBI-visuals-TextFilter&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;release to just upload to powerbi here.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://github.com/gmmeyers/PowerBI-visuals-TextFilter/releases/tag/1.0.0" target="_blank"&gt;https://github.com/gmmeyers/PowerBI-visuals-TextFilter/releases/tag/1.0.0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 17:52:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multicolumn-Filtering-via-typescript-searchbar/m-p/2593252#M36876</guid>
      <dc:creator>Merxvell</dc:creator>
      <dc:date>2022-06-22T17:52:10Z</dc:date>
    </item>
  </channel>
</rss>

