<?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 Add one datafield to multiple measures in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2111121#M32190</link>
    <description>&lt;P&gt;I have a capabilities files with some measures in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  "dataRoles": [
    {
      "displayName": "Chart 1 X-Axis",
      "name": "chart1_X",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 1 Y-Axis",
      "name": "chart1_Y",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 2 X-Axis",
      "name": "chart2_X",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 2 Y-Axis",
      "name": "chart2_Y",
      "kind": "Measure"
    },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to ad one datafield to multiple measures. But power bi sees the measure only onece.&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="GuFa_0-1633104958182.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/604990i5574249CB0E2E67B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuFa_0-1633104958182.png" alt="GuFa_0-1633104958182.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have at categories.values[2] params2 instead of TotalSegment. I read the Input via a loop and would like to have TotalSegment at categories.values[2].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hints help appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 16:18:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-01T16:18:53Z</dc:date>
    <item>
      <title>Add one datafield to multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2111121#M32190</link>
      <description>&lt;P&gt;I have a capabilities files with some measures in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  "dataRoles": [
    {
      "displayName": "Chart 1 X-Axis",
      "name": "chart1_X",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 1 Y-Axis",
      "name": "chart1_Y",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 2 X-Axis",
      "name": "chart2_X",
      "kind": "Measure"
    },
    {
      "displayName": "Chart 2 Y-Axis",
      "name": "chart2_Y",
      "kind": "Measure"
    },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to ad one datafield to multiple measures. But power bi sees the measure only onece.&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="GuFa_0-1633104958182.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/604990i5574249CB0E2E67B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="GuFa_0-1633104958182.png" alt="GuFa_0-1633104958182.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have at categories.values[2] params2 instead of TotalSegment. I read the Input via a loop and would like to have TotalSegment at categories.values[2].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hints help appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 16:18:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2111121#M32190</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-01T16:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add one datafield to multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2112611#M32196</link>
      <description>&lt;P&gt;Hi @Anonymous,&lt;/P&gt;
&lt;P&gt;It's great that you're thinking about this scenario from an end-user perspective and making sure that you have a path for it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;From a data perspective, this is a limitation with Power BI that cannot be managed in this way: a column or measure can only be referenced once in an underlying query and as such cannot be mapped to the data view twice. You can't do much about it from withn the capabilities, as you want a user to be able to add a column in here; as such you will need to manage this internally when mapping your data from the data view into your viewmodel based on checking for conditions.&lt;/P&gt;
&lt;P&gt;How you might approach this at a high-level is something like the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When mapping your data to your view model, check to see if you have anything in the &lt;FONT face="courier new,courier"&gt;chart2_X&lt;/FONT&gt; data role for the data view. You can use &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-dataview#datarolehelper" target="_self"&gt;methods in the &lt;FONT face="courier new,courier"&gt;DataRoleHelper&lt;/FONT&gt; to assist with this&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;If you do have a different column present, bind the values from the discovered column in your viewmodel; if not, bind the values from &lt;FONT face="courier new,courier"&gt;chart1_X&lt;/FONT&gt;'s column/role.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You may find a better way based on your implementation, but this might give you some ideas to try.&lt;/P&gt;
&lt;P&gt;Good luck,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Sun, 03 Oct 2021 19:17:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2112611#M32196</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2021-10-03T19:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add one datafield to multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2114555#M32220</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for detailed explanation, it helped a lot :). At metadata I can see all the input datafields. I was able to grab and copy them into my data array.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 09:06:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Add-one-datafield-to-multiple-measures/m-p/2114555#M32220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-13T09:06:19Z</dc:date>
    </item>
  </channel>
</rss>

