<?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 How Do We Structure SelectionIDs to Store objects in the Data View Mapping for Series or Measure? in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-Do-We-Structure-SelectionIDs-to-Store-objects-in-the-Data/m-p/801144#M2602</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I'm implementing a visual with similar behaviour to the clustered column chart core visual and have some very similar data bindings for colour in the properties pane. This should ideally bind as per the clustered column chart, i.e.:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the user provides a series (Legend) field then series values are enumerated and added to the pane.&lt;/LI&gt;&lt;LI&gt;If the user provides no series (Legend) field but multiple measures, then the measure values are enumerated and added to the pane.&lt;/LI&gt;&lt;LI&gt;If none of the above are hit, then categories are bound to the pane.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I can actually get the above to list in the pane for each situation, but my challenge is pushing the &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; into the data view for scenarios 1 and 2 when I select a colour from the palette and persisting the selected value.&lt;/P&gt;&lt;P&gt;The only one that works reliably is 3, which is as &lt;A href="https://microsoft.github.io/PowerBI-visuals/tutorials/building-bar-chart/adding-databound-objects-to-property-pane/" target="_self"&gt;per the example&lt;/A&gt;. In this case, the generated &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; is getting pushed into &lt;FONT face="courier new,courier"&gt;categorical.categories[n].objects&lt;/FONT&gt; as expected.&lt;/P&gt;&lt;P&gt;My &lt;FONT face="courier new,courier"&gt;dataViewMapping&lt;/FONT&gt; is configured as follows:&lt;/P&gt;&lt;PRE&gt;"categorical": {
    "categories": {
        "for": {
            "in": "category"
        }
    },
    "values": {
        "group": {
            "by": "series",
            "select": [
                {
                    "bind": {
                        "to" :"measure"
                    }
                }
            ]
        }
    }
}&lt;/PRE&gt;&lt;P&gt;In the case of where I need to generate a selectionId &lt;FONT face="courier new,courier"&gt;.withSeries()&lt;/FONT&gt; and/or &lt;FONT face="courier new,courier"&gt;.withMeasure()&lt;/FONT&gt;, I can get a valid &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt;&amp;nbsp;for the combination of fields.&lt;/P&gt;&lt;P&gt;However, using it with &lt;FONT face="courier new,courier"&gt;objectEnumeration.push&lt;/FONT&gt; does not put it into the &lt;FONT face="courier new,courier"&gt;dataView&lt;/FONT&gt;, which I assume should push it into &lt;FONT face="courier new,courier"&gt;categorical.values[n].objects&lt;/FONT&gt;&amp;nbsp;at the appropriate location. This doesn't seem to happen... or end up anywhere in the &lt;FONT face="courier new,courier"&gt;dataView&lt;/FONT&gt; that I can find.&lt;/P&gt;&lt;P&gt;Can someone shed any light on how I should be approaching/managing this? It's clearly possible to do but maybe I'm thinking about it the wrong way.&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 22:08:39 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2019-09-24T22:08:39Z</dc:date>
    <item>
      <title>How Do We Structure SelectionIDs to Store objects in the Data View Mapping for Series or Measure?</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-Do-We-Structure-SelectionIDs-to-Store-objects-in-the-Data/m-p/801144#M2602</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I'm implementing a visual with similar behaviour to the clustered column chart core visual and have some very similar data bindings for colour in the properties pane. This should ideally bind as per the clustered column chart, i.e.:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the user provides a series (Legend) field then series values are enumerated and added to the pane.&lt;/LI&gt;&lt;LI&gt;If the user provides no series (Legend) field but multiple measures, then the measure values are enumerated and added to the pane.&lt;/LI&gt;&lt;LI&gt;If none of the above are hit, then categories are bound to the pane.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I can actually get the above to list in the pane for each situation, but my challenge is pushing the &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; into the data view for scenarios 1 and 2 when I select a colour from the palette and persisting the selected value.&lt;/P&gt;&lt;P&gt;The only one that works reliably is 3, which is as &lt;A href="https://microsoft.github.io/PowerBI-visuals/tutorials/building-bar-chart/adding-databound-objects-to-property-pane/" target="_self"&gt;per the example&lt;/A&gt;. In this case, the generated &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt; is getting pushed into &lt;FONT face="courier new,courier"&gt;categorical.categories[n].objects&lt;/FONT&gt; as expected.&lt;/P&gt;&lt;P&gt;My &lt;FONT face="courier new,courier"&gt;dataViewMapping&lt;/FONT&gt; is configured as follows:&lt;/P&gt;&lt;PRE&gt;"categorical": {
    "categories": {
        "for": {
            "in": "category"
        }
    },
    "values": {
        "group": {
            "by": "series",
            "select": [
                {
                    "bind": {
                        "to" :"measure"
                    }
                }
            ]
        }
    }
}&lt;/PRE&gt;&lt;P&gt;In the case of where I need to generate a selectionId &lt;FONT face="courier new,courier"&gt;.withSeries()&lt;/FONT&gt; and/or &lt;FONT face="courier new,courier"&gt;.withMeasure()&lt;/FONT&gt;, I can get a valid &lt;FONT face="courier new,courier"&gt;selectionId&lt;/FONT&gt;&amp;nbsp;for the combination of fields.&lt;/P&gt;&lt;P&gt;However, using it with &lt;FONT face="courier new,courier"&gt;objectEnumeration.push&lt;/FONT&gt; does not put it into the &lt;FONT face="courier new,courier"&gt;dataView&lt;/FONT&gt;, which I assume should push it into &lt;FONT face="courier new,courier"&gt;categorical.values[n].objects&lt;/FONT&gt;&amp;nbsp;at the appropriate location. This doesn't seem to happen... or end up anywhere in the &lt;FONT face="courier new,courier"&gt;dataView&lt;/FONT&gt; that I can find.&lt;/P&gt;&lt;P&gt;Can someone shed any light on how I should be approaching/managing this? It's clearly possible to do but maybe I'm thinking about it the wrong way.&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 22:08:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-Do-We-Structure-SelectionIDs-to-Store-objects-in-the-Data/m-p/801144#M2602</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2019-09-24T22:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How Do We Structure SelectionIDs to Store objects in the Data View Mapping for Series or Measure</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-Do-We-Structure-SelectionIDs-to-Store-objects-in-the-Data/m-p/806976#M2622</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could check the source code of Mekko Chart because it has similar cases.&lt;/P&gt;&lt;P&gt;Please check &lt;A href="https://github.com/microsoft/powerbi-visuals-mekkochart/blob/416003bc95c3352d9c0e1acc210f71456123a00d/src/converterStrategy/baseConverterStrategy.ts#L240" target="_self"&gt;there&lt;/A&gt; and &lt;A href="https://github.com/microsoft/powerbi-visuals-mekkochart/blob/c1a4c68e1e5b1315ca4bd11b54fb9861d875f32c/src/columnChart/baseColumnChart.ts#L924" target="_self"&gt;there&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>Tue, 01 Oct 2019 13:55:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/How-Do-We-Structure-SelectionIDs-to-Store-objects-in-the-Data/m-p/806976#M2622</guid>
      <dc:creator>v-evelk</dc:creator>
      <dc:date>2019-10-01T13:55:32Z</dc:date>
    </item>
  </channel>
</rss>

