<?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: Custom visual Table using Javascript &amp;amp;colon; Filter Row, Column and single Cell in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/704508#M2219</link>
    <description>&lt;P&gt;I solved by my self.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the fragment of code I have used, maybe it could help others.&lt;/P&gt;&lt;PRE&gt;private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
        return dataView.table.identity.map((identity: data.SelectorsByColumn) =&amp;gt; {
            const categoryColumn: DataViewCategoryColumn = {
                source: dataView.table.columns[1],
                values: null,
                identity: [identity]
            };

            return host.createSelectionIdBuilder()
                .withCategory(categoryColumn, 0)
                .createSelectionId();
        });
        }&lt;/PRE&gt;&lt;P&gt;Using this I am able to filter the table by row. I am talking abot versione 2.5.0. The version for 1.6 suggest by someone on internet is:&lt;/P&gt;&lt;PRE&gt;private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
            return dataView.table.identity.map((identity: DataViewScopeIdentity) =&amp;gt; {
                const categoryColumn: DataViewCategoryColumn = {
                    source: dataView.table.columns[0],
                    values: null,
                    identity: [identity]
                };
        
                return host.createSelectionIdBuilder()
                    .withCategory(categoryColumn, 0)
                    .createSelectionId();
            });
        }&lt;/PRE&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;Thank you anyway,&lt;/P&gt;&lt;P&gt;Francesco Multari&lt;/P&gt;</description>
    <pubDate>Fri, 31 May 2019 13:51:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-05-31T13:51:02Z</dc:date>
    <item>
      <title>Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/700486#M2197</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I am writing here hoping to find someone who can help me to find the correct way to develop a custom table visual for power BI.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;At this moment I am able to take data from capabilites file using:&lt;/P&gt;&lt;PRE&gt; var table: DataViewTable = options.dataViews[0].table

            var columns: DataViewMetadataColumn[] = table.columns;

            var rows: DataViewTableRow[] = table.rows;&lt;/PRE&gt;&lt;P&gt;After that I manipulate it and I put them in a html table(thead and tbody).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;var columnsName = [];

            for (var i = 0; i &amp;lt; columns.length; i++) {
                columnsName[i] = columns[i].displayName
            }

            var stringToBuild = "["

            for (var i = 0; i &amp;lt; rows.length; i++) {
                stringToBuild += "{"
                for (var j = 0; j &amp;lt; columnsName.length; j++) {

                    var colName = columnsName[j]
                    var newLocal = rows[i][j];
                    stringToBuild += "\"" + colName + "\": " + "\"" + newLocal + "\""

                    if (j != columnsName.length - 1) {
                        stringToBuild += ","
                    }
                }
                stringToBuild += "}"
                if (i != rows.length - 1) {
                    stringToBuild += ","
                }
            }
            stringToBuild += "]"
 var valueToRepresent =JSON.parse(stringToBuild)

this.thead.append('tr')
                .selectAll('th')
                .data(columnsName)
                .enter()
                .append("th")
                .text(function (columnsName) { return columnsName; })
                .style("background-color", this.settings.headerFormatting.color)
                .style("font-size", this.settings.headerFormatting.size + "px")
                .style("color",this.settings.headerFormatting.colorFont);

            // create a row for each object in the data
            this.tbody.selectAll('tr')
                .data(valueToRepresent)
                .enter()
                .append('tr');
          
            // create a cell in each row for each column
            var cells = this.tbody.selectAll('tr').selectAll('td')
                .data(function (row) {
                    return columnsName.map(function (column) {
                        return { column: column, value: row[column] };
                    });
                })
                .enter()
                .append('td')
                .text(function (d) { return d.value; });&lt;/PRE&gt;&lt;P&gt;This way&amp;nbsp; it works fine.&lt;BR /&gt;Now my next goal is to add the possibility to chick on row and filter all the visuals based on that row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone can help me?&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2019 10:42:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/700486#M2197</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-27T10:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/701569#M2203</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check &lt;A href="https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/adding-selection-and-interaction-with-other-visuals/" target="_self"&gt;this article&lt;/A&gt; please.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evgenii Elkin,&lt;BR /&gt;Software Engineer&lt;BR /&gt;Microsoft Power BI Custom Visuals&lt;BR /&gt;pbicvsupport@microsoft.com&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 15:47:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/701569#M2203</guid>
      <dc:creator>v-evelk</dc:creator>
      <dc:date>2019-05-28T15:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702171#M2205</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I alredy know that link, but there is no explation about dealing with table in capabilities.&lt;BR /&gt;That link works only with category.&lt;/P&gt;&lt;P&gt;Could you kindly give me other example?&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Francesco&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 08:34:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702171#M2205</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-29T08:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702529#M2207</link>
      <description>&lt;P&gt;Hi Francesco,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You should use&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;API 2.5&lt;/STRONG&gt;&lt;SPAN&gt;. It&amp;nbsp;contains&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;.withTable&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;method of the builder that must solve selection issues with Table mapping.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kind Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Evgenii Elkin,&lt;BR /&gt;Software Engineer&lt;BR /&gt;Microsoft Power BI Custom Visuals&lt;BR /&gt;pbicvsupport@microsoft.com&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 15:16:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702529#M2207</guid>
      <dc:creator>v-evelk</dc:creator>
      <dc:date>2019-05-29T15:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702539#M2208</link>
      <description>&lt;P&gt;Hi, I am using the version&amp;nbsp;&lt;STRONG&gt;API 2.5&lt;/STRONG&gt; but I am little confused using withTable. Could you give me an example?&lt;BR /&gt;Moreover, using withTable I can only filter by row number, right?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 15:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/702539#M2208</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-29T15:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/703509#M2215</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no documentation with examples for a while but yes, you need to set rowNumber and colNumber like &lt;A href="https://github.com/microsoft/PowerBI-visuals-tools/issues/263#issuecomment-496118752" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evgenii Elkin,&lt;BR /&gt;Software Engineer&lt;BR /&gt;Microsoft Power BI Custom Visuals&lt;BR /&gt;pbicvsupport@microsoft.com&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 15:21:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/703509#M2215</guid>
      <dc:creator>v-evelk</dc:creator>
      <dc:date>2019-05-30T15:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Custom visual Table using Javascript &amp;colon; Filter Row, Column and single Cell</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/704508#M2219</link>
      <description>&lt;P&gt;I solved by my self.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the fragment of code I have used, maybe it could help others.&lt;/P&gt;&lt;PRE&gt;private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
        return dataView.table.identity.map((identity: data.SelectorsByColumn) =&amp;gt; {
            const categoryColumn: DataViewCategoryColumn = {
                source: dataView.table.columns[1],
                values: null,
                identity: [identity]
            };

            return host.createSelectionIdBuilder()
                .withCategory(categoryColumn, 0)
                .createSelectionId();
        });
        }&lt;/PRE&gt;&lt;P&gt;Using this I am able to filter the table by row. I am talking abot versione 2.5.0. The version for 1.6 suggest by someone on internet is:&lt;/P&gt;&lt;PRE&gt;private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] {
            return dataView.table.identity.map((identity: DataViewScopeIdentity) =&amp;gt; {
                const categoryColumn: DataViewCategoryColumn = {
                    source: dataView.table.columns[0],
                    values: null,
                    identity: [identity]
                };
        
                return host.createSelectionIdBuilder()
                    .withCategory(categoryColumn, 0)
                    .createSelectionId();
            });
        }&lt;/PRE&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;Thank you anyway,&lt;/P&gt;&lt;P&gt;Francesco Multari&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 13:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Custom-visual-Table-using-Javascript-amp-colon-Filter-Row-Column/m-p/704508#M2219</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-31T13:51:02Z</dc:date>
    </item>
  </channel>
</rss>

