<?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: Setting data fields is unique in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3754559#M9208</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the documentation (i didn't read it all), I don't know if it exists a normal way to say "don't accept this field if it has already been added".&lt;/P&gt;&lt;P&gt;You can probably find a way to "hard-code" this but I don't think it's a good idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you can manage the Data Roles in the capabilities.json file to ensure the data you drag into your fields respect the data type (related to Power BI Data Types)&lt;/P&gt;&lt;P&gt;&lt;A title="Capabilities and properties of Power BI visuals" href="https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#dataroles-define-the-data-fields-that-your-visual-expects" target="_blank" rel="noopener"&gt;Capabilities and properties of Power BI visuals - Power BI | Microsoft Learn&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you can watch the others custom visual codes to get an idea about how you can manage your data roles:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;A title="Github Custom Visuals" href="https://github.com/MicrosoftDocs/powerbi-docs/blob/live/powerbi-docs/developer/visuals/samples.md" target="_blank" rel="noopener noreferrer"&gt;Github Custom Visuals&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By the way, I think the best way to develop your custom visual is not to make sure that the users won't be able to drag 2 or more times the same data, but to be sure that your data roles are well defined to prevent misunderstanding and avoid this case when the same data is dragged too much times&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Have good day&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2024 09:14:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-11T09:14:20Z</dc:date>
    <item>
      <title>Setting data fields is unique</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3750378#M9170</link>
      <description>&lt;P&gt;Hello every one,&amp;nbsp;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NgaMoon_0-1709870857197.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1056357i16FCE4D5AB3988C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NgaMoon_0-1709870857197.png" alt="NgaMoon_0-1709870857197.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a small problem with my custom visuals that when I drag data into the visualizations box it can overlap, meaning I can drag "Profit" into both column and value, I want to set it to only be able to pulled into a single field. How can that be done? Below are the capabilities of Hope everyone can help&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"dataRoles"&lt;/SPAN&gt;&lt;SPAN&gt;: [&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"name"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"columns"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&g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lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Mar 2024 04:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3750378#M9170</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-08T04:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting data fields is unique</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3753761#M9207</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;,&amp;nbsp;Sorry for pinning you on this news, but can you tell me if there is a way for each data field to only be dragged and dropped into 1 visualizations&amp;nbsp; field?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 02:24:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3753761#M9207</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-11T02:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting data fields is unique</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3754559#M9208</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As seen in the documentation (i didn't read it all), I don't know if it exists a normal way to say "don't accept this field if it has already been added".&lt;/P&gt;&lt;P&gt;You can probably find a way to "hard-code" this but I don't think it's a good idea.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you can manage the Data Roles in the capabilities.json file to ensure the data you drag into your fields respect the data type (related to Power BI Data Types)&lt;/P&gt;&lt;P&gt;&lt;A title="Capabilities and properties of Power BI visuals" href="https://learn.microsoft.com/en-us/power-bi/developer/visuals/capabilities#dataroles-define-the-data-fields-that-your-visual-expects" target="_blank" rel="noopener"&gt;Capabilities and properties of Power BI visuals - Power BI | Microsoft Learn&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you can watch the others custom visual codes to get an idea about how you can manage your data roles:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;A title="Github Custom Visuals" href="https://github.com/MicrosoftDocs/powerbi-docs/blob/live/powerbi-docs/developer/visuals/samples.md" target="_blank" rel="noopener noreferrer"&gt;Github Custom Visuals&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By the way, I think the best way to develop your custom visual is not to make sure that the users won't be able to drag 2 or more times the same data, but to be sure that your data roles are well defined to prevent misunderstanding and avoid this case when the same data is dragged too much times&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Have good day&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 09:14:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3754559#M9208</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-11T09:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Setting data fields is unique</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3758113#M9216</link>
      <description>&lt;P&gt;This isn't currently possible. You can constrain fields by their data type (or column/measure type) in the dataRoles, but you can't prevent a user from adding the same column or measure multiple times to the data view.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:40:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Setting-data-fields-is-unique/m-p/3758113#M9216</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2024-03-12T13:40:03Z</dc:date>
    </item>
  </channel>
</rss>

