<?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: USERELATIONSHIP not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571334#M73449</link>
    <description>&lt;P&gt;Is it possible without using a bridge table&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 09:16:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-10T09:16:52Z</dc:date>
    <item>
      <title>USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2570953#M73428</link>
      <description>&lt;P&gt;I have a table NU with the below data :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AC No&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SA&amp;nbsp; &amp;nbsp;LC&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;156657&lt;/TD&gt;&lt;TD&gt;898&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;156657&lt;/TD&gt;&lt;TD&gt;-90&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;877879&lt;/TD&gt;&lt;TD&gt;213&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;877879&lt;/TD&gt;&lt;TD&gt;242&lt;/TD&gt;&lt;TD&gt;d&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;34&lt;/TD&gt;&lt;TD&gt;e&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table RR with the below data :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cust&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FA&amp;nbsp; &amp;nbsp; &amp;nbsp; LC&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;156657&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;156657&lt;/TD&gt;&lt;TD&gt;29&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;156657&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;877879&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;877879&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relationship is as shown : (Many to many inactive relationship btw Ac no and Cust)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a measure&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FA cus = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'RR'[FA]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'RR'[Cust]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'NU'[AC No]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;to activate the inactive relationship&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Now i want AC no against&amp;nbsp;&lt;SPAN&gt;FA cus&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But the expected value is 79 and im getting 199, seems like the inactive relationship is not turned on? what is the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File attached:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1vK3tM1YEFigmzzrln66jA0rzWW01ZzWu/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/1vK3tM1YEFigmzzrln66jA0rzWW01ZzWu/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jun 2022 07:32:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2570953#M73428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-10T07:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571330#M73448</link>
      <description>&lt;P&gt;After using Power Query to replace the null values in NU[Ac no] with -1 I created a dimension table for all account &amp;amp; customer numbers with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Account numbers = DISTINCT( 
    UNION(
        ALLNOBLANKROW(NU[AC No]),
        ALLNOBLANKROW(RR[Cust])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;I then deleted the many-to-many relationship between the two existing tables and added 1-to-many relationships from the new Account Numbers table to both. One of these relationships has to be inactive due to the existing relationship between tables, it doesn't matter which one.&lt;/P&gt;&lt;P&gt;I then created a measure&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FA by ac no = CALCULATE( SUM(RR[FA]), USERELATIONSHIP('Account numbers'[AC No], RR[Cust]))&lt;/LI-CODE&gt;&lt;P&gt;put the 'Account numbers'[AC No] field into a table with the new measure and you get the correct results.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:15:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571330#M73448</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-06-10T09:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571334#M73449</link>
      <description>&lt;P&gt;Is it possible without using a bridge table&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:16:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571334#M73449</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-10T09:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571348#M73452</link>
      <description>&lt;P&gt;I don't think so. I created a measure&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Num cust = COALESCE( CALCULATE( COUNTROWS(RR), USERELATIONSHIP(NU[AC No], RR[Cust])), 0)&lt;/LI-CODE&gt;&lt;P&gt;which gives very strange results&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I don't understand why the relationship is messed up, but cleaning up the data seems to fix the problem&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:25:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571348#M73452</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-06-10T09:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571375#M73453</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;Some times you need to CROSSFILTER the other relationship to None&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;FA cus = 
CALCULATE (
    SUM ( 'RR'[FA] ),
    USERELATIONSHIP ('RR'[Cust], 'NU'[AC No] ),
    CROSSFILTER ( 'RR'[LC], NU[LC], NONE )  
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 09:33:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2571375#M73453</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-06-10T09:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: USERELATIONSHIP not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2582159#M74120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ kalyj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 06:53:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/USERELATIONSHIP-not-working/m-p/2582159#M74120</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-16T06:53:23Z</dc:date>
    </item>
  </channel>
</rss>

