<?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: Selections for matrix data view mapping in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Selections-for-matrix-data-view-mapping/m-p/950743#M22508</link>
    <description>&lt;P&gt;try this&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Developer/multi-selection-with-AND-operator/m-p/781012#M20577" target="_blank"&gt;https://community.powerbi.com/t5/Developer/multi-selection-with-AND-operator/m-p/781012#M20577&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;host.createSelectionIdBuilder();&lt;/PRE&gt;&lt;P&gt;make that code inside each looping&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root.each(d =&amp;gt; {
let builder = ... ; // create builder here
d.selectionId = builder.withMatrixNode(d, dataViews.rows.levels).createSelectionId();
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 09:54:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-27T09:54:09Z</dc:date>
    <item>
      <title>Selections for matrix data view mapping</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Selections-for-matrix-data-view-mapping/m-p/938365#M22363</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create selections using SELECTION MANAGER for a custom visual which uses matrix data mapping but to no avail&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the relevant excerpts. Would be so grateful for your time and help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; constructor(options: VisualConstructorOptions) {
            this.selectionManager = options.host.createSelectionManager();
            this.selectionIdBuilder = options.host.createSelectionIdBuilder();
    }

public update(options: VisualUpdateOptions) {
        let dataViews = options.dataViews[0].matrix;
        if (!dataViews
            || !dataViews.rows
            || !dataViews.rows.root
            || !dataViews.rows.root.children
            || !dataViews.rows.root.children.length
            || !dataViews.columns
            || !dataViews.columns.root
            || !dataViews.columns.root.children
            || !dataViews.columns.root.children.length) { return }

  let root = d3.hierarchy(dataViews.rows.root)

 root.each(d =&amp;gt; d.selectionId = this.selectionIdBuilder.withMatrixNode(d, dataViews.rows.levels)
              .createSelectionId())
console.log(root)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;here is dataview mapping from my Capabilities.json&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;   "dataViewMappings": [
        {
            "matrix": {
                "rows": {
                    "for": {
                        "in": "Category"
                    }
                },
                "values": {
                    "select": [
                        {
                            "for": {
                                "in": "Measure"
                            }
                        }
                    ]
                }
            }
        }
    ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is snap for my console. I get the selectionID property but it is same for all nodes(parent/child) and the key is null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="selections.png" style="width: 999px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/236905i75D33127462140C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="selections.png" alt="selections.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/61993"&gt;@Nishantjain&lt;/a&gt;&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&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;</description>
      <pubDate>Wed, 19 Feb 2020 07:04:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Selections-for-matrix-data-view-mapping/m-p/938365#M22363</guid>
      <dc:creator>Husain</dc:creator>
      <dc:date>2020-02-19T07:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Selections for matrix data view mapping</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Selections-for-matrix-data-view-mapping/m-p/950743#M22508</link>
      <description>&lt;P&gt;try this&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Developer/multi-selection-with-AND-operator/m-p/781012#M20577" target="_blank"&gt;https://community.powerbi.com/t5/Developer/multi-selection-with-AND-operator/m-p/781012#M20577&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;host.createSelectionIdBuilder();&lt;/PRE&gt;&lt;P&gt;make that code inside each looping&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;root.each(d =&amp;gt; {
let builder = ... ; // create builder here
d.selectionId = builder.withMatrixNode(d, dataViews.rows.levels).createSelectionId();
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 09:54:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Selections-for-matrix-data-view-mapping/m-p/950743#M22508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-27T09:54:09Z</dc:date>
    </item>
  </channel>
</rss>

