<?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 Multi fields slicer and bookmarks in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Multi-fields-slicer-and-bookmarks/m-p/433406#M13299</link>
    <description>&lt;P&gt;My visual works like a slicer, you can add several categories and each of them is rendered as a HTML list.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;With a single category, all is pretty simple because each item of the list is represented by just one selectionId.&lt;BR /&gt;With two o more lists, the things become more complex because every item is represented by multiple selectionIds that contain the lowest grain of all categories added.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, with multiple lists, when the user selects an item, my visual has to pass several selectionIDs to the selectionManager in order to filter the report properly.&lt;BR /&gt;It is not a big issue, but my problems start when the user clicks on a bookmark.&lt;BR /&gt;In this case, my visual receives a complex filter. Analyzing the filter, I'm not able to know which list was real selected, so I have to select all the values passed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look a these screenshots: the first one shows what the user has selected (just the category Computers), the second one is a fragment of the filter received after a bookmark with the same selection (just the category Computers) is clicked, the third one is the bookmark render.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wanted.png" style="width: 287px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99576i505EF8E08F6A8816/image-size/large?v=v2&amp;amp;px=999" role="button" title="wanted.png" alt="wanted.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filter.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99577iCFCB259C8848069E/image-size/large?v=v2&amp;amp;px=999" role="button" title="filter.png" alt="filter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="not-wanted.jpg" style="width: 283px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99578i64484D96A65FAD4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="not-wanted.jpg" alt="not-wanted.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this example, I don't want to select all the subcategories, just the parent category, but I have to do so, beacuse they are stored in the filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to solve the issue by using different approaches.&lt;BR /&gt;I tried to apply the selection with a BasicFilter instead of selectionManager with multiple selectionsIds, but I'm not able to add different columns to the same BasicFilter or to apply different BasicFilters with &lt;STRONG&gt;host.applyJsonFilter()&lt;/STRONG&gt; function.&lt;BR /&gt;So I tried an undocumented (and unsupported, I guess) way, inspired by your FilterManager.restoreSelectionIds() function.&lt;BR /&gt;Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let category = ...; //DataViewCategoryColumn
let value = ...; //Text value
let fieldExpr = powerbi["data"].SQExprBuilder.fieldExpr({ 
      column: { 
          entity: category.queryName.substr(0, category.queryName.indexOf('.')), 
          name: category.source.displayName 
      } 
});
let expr = powerbi["data"].SQExprBuilder.equal(fieldExpr, powerbi["data"].SQExprBuilder.text(value));
let identity = powerbi["data"].createDataViewScopeIdentity(expr);
let selectionId = (&amp;lt;any&amp;gt;powerbi["visuals"]).SelectionId.createWithId(identity);
this.selectionManager.select(selectionId, true);&lt;/PRE&gt;&lt;P&gt;The code above works only with selections from the same category, but produces an advanced filter and breaks the report when multiple categories are involved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me in understanding how to solve my issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jun 2018 08:52:40 GMT</pubDate>
    <dc:creator>danieleperilli</dc:creator>
    <dc:date>2018-06-06T08:52:40Z</dc:date>
    <item>
      <title>Multi fields slicer and bookmarks</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multi-fields-slicer-and-bookmarks/m-p/433406#M13299</link>
      <description>&lt;P&gt;My visual works like a slicer, you can add several categories and each of them is rendered as a HTML list.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;With a single category, all is pretty simple because each item of the list is represented by just one selectionId.&lt;BR /&gt;With two o more lists, the things become more complex because every item is represented by multiple selectionIds that contain the lowest grain of all categories added.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So, with multiple lists, when the user selects an item, my visual has to pass several selectionIDs to the selectionManager in order to filter the report properly.&lt;BR /&gt;It is not a big issue, but my problems start when the user clicks on a bookmark.&lt;BR /&gt;In this case, my visual receives a complex filter. Analyzing the filter, I'm not able to know which list was real selected, so I have to select all the values passed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look a these screenshots: the first one shows what the user has selected (just the category Computers), the second one is a fragment of the filter received after a bookmark with the same selection (just the category Computers) is clicked, the third one is the bookmark render.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wanted.png" style="width: 287px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99576i505EF8E08F6A8816/image-size/large?v=v2&amp;amp;px=999" role="button" title="wanted.png" alt="wanted.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filter.png" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99577iCFCB259C8848069E/image-size/large?v=v2&amp;amp;px=999" role="button" title="filter.png" alt="filter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="not-wanted.jpg" style="width: 283px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/99578i64484D96A65FAD4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="not-wanted.jpg" alt="not-wanted.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this example, I don't want to select all the subcategories, just the parent category, but I have to do so, beacuse they are stored in the filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to solve the issue by using different approaches.&lt;BR /&gt;I tried to apply the selection with a BasicFilter instead of selectionManager with multiple selectionsIds, but I'm not able to add different columns to the same BasicFilter or to apply different BasicFilters with &lt;STRONG&gt;host.applyJsonFilter()&lt;/STRONG&gt; function.&lt;BR /&gt;So I tried an undocumented (and unsupported, I guess) way, inspired by your FilterManager.restoreSelectionIds() function.&lt;BR /&gt;Something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let category = ...; //DataViewCategoryColumn
let value = ...; //Text value
let fieldExpr = powerbi["data"].SQExprBuilder.fieldExpr({ 
      column: { 
          entity: category.queryName.substr(0, category.queryName.indexOf('.')), 
          name: category.source.displayName 
      } 
});
let expr = powerbi["data"].SQExprBuilder.equal(fieldExpr, powerbi["data"].SQExprBuilder.text(value));
let identity = powerbi["data"].createDataViewScopeIdentity(expr);
let selectionId = (&amp;lt;any&amp;gt;powerbi["visuals"]).SelectionId.createWithId(identity);
this.selectionManager.select(selectionId, true);&lt;/PRE&gt;&lt;P&gt;The code above works only with selections from the same category, but produces an advanced filter and breaks the report when multiple categories are involved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me in understanding how to solve my issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 08:52:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multi-fields-slicer-and-bookmarks/m-p/433406#M13299</guid>
      <dc:creator>danieleperilli</dc:creator>
      <dc:date>2018-06-06T08:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multi fields slicer and bookmarks</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Multi-fields-slicer-and-bookmarks/m-p/434426#M13366</link>
      <description>&lt;P&gt;Power BI CV API does not support multi column filtering well.&lt;/P&gt;
&lt;P&gt;We're developing an API to support multi columns filtering but there's no ETA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We'll share more details later once design and implementation is done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Ignat Vilesov,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Software Engineer&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt; color: #333333;"&gt;Microsoft Power BI Custom Visuals&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A href="mailto:pbicvsupport@microsoft.com" target="_blank"&gt;&lt;SPAN&gt;pbicvsupport@microsoft.com&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 08:23:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Multi-fields-slicer-and-bookmarks/m-p/434426#M13366</guid>
      <dc:creator>v-viig</dc:creator>
      <dc:date>2018-06-07T08:23:23Z</dc:date>
    </item>
  </channel>
</rss>

