<?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: Use RELATED with USERELATIONSHIP or something similar to use an inactive relationship in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/4071528#M161623</link>
    <description>&lt;P&gt;I'm popping in way after you posted this solution to say, thanks! This helped me work out something in my report.&lt;BR /&gt;&lt;BR /&gt;Only thing is I had to add a second filter condition to the Calculate, something like&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;'Category Table'[CODE]=SelectedCategory. Otherwise I was getting an array instead of one value.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2024 14:15:00 GMT</pubDate>
    <dc:creator>Sandra_aaA</dc:creator>
    <dc:date>2024-07-31T14:15:00Z</dc:date>
    <item>
      <title>Use RELATED with USERELATIONSHIP or something similar to use an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3733718#M145517</link>
      <description>&lt;P&gt;So I want to make a calculated column that takes a value in another table and I would usually use the RELATED function but I can't since they are related with an inactive relationship. Is there any way to do that ?&lt;BR /&gt;&lt;BR /&gt;Here is a screenshot of the tables and the inactive relationship :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to put the related CODE1 in Daily Operation Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 14:01:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3733718#M145517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-29T14:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Use RELATED with USERELATIONSHIP or something similar to use an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3733756#M145520</link>
      <description>&lt;P&gt;In Power BI, when you have an inactive relationship between tables and you want to use the RELATED function or something similar to access values from another table, you can utilize USERELATIONSHIP in your DAX calculations. Here's how you can achieve this:&lt;/P&gt;&lt;P&gt;Suppose you have two tables: "Daily Operation Table" and "Category Table" with an inactive relationship between them based on the "CODE" column.&lt;/P&gt;&lt;P&gt;Let's say you want to bring the "CODE1" value from the "Category Table" into the "Daily Operation Table" using DAX. You can use the USERELATIONSHIP function to specify the inactive relationship. Here's an example of how you can create a calculated column in the "Daily Operation Table" to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RelatedCode1 =&lt;BR /&gt;VAR SelectedCategory = 'Daily Operation Table'[Category] // Assuming 'Category' is the related column&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;VALUES ( 'Category Table'[CODE1] ),&lt;BR /&gt;USERELATIONSHIP ( 'Category Table'[CODE], 'Daily Operation Table'[Category] )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this formula:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We first store the value of the related column from the "Daily Operation Table" in a variable named SelectedCategory.&lt;/LI&gt;&lt;LI&gt;Then, we use the CALCULATE function to evaluate the expression in a context modified by the USERELATIONSHIP function.&lt;/LI&gt;&lt;LI&gt;USERELATIONSHIP is used to specify the inactive relationship between the "Category Table" and the "Daily Operation Table" based on the "CODE" column.&lt;/LI&gt;&lt;LI&gt;Finally, we retrieve the related "CODE1" value from the "Category Table" based on the specified relationship.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Ensure that you replace 'Category' with the actual name of the related column in the "Daily Operation Table" and adjust the column names as per your data model. This DAX expression should allow you to retrieve the related "CODE1" values even with the inactive relationship.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 14:17:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3733756#M145520</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-29T14:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Use RELATED with USERELATIONSHIP or something similar to use an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3735831#M145613</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on what 123abc said, here are some of my additions.&lt;/P&gt;
&lt;P&gt;When dealing with inactive relationships in Power BI or other DAX-based tools, you can use the &lt;STRONG&gt;USERELATIONSHIP&lt;/STRONG&gt; function to temporarily activate the inactive relationship for a specific calculation.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The RELATED function&lt;/STRONG&gt; is a value function that returns the relevant values from the association table.&amp;nbsp;&lt;STRONG&gt;The USERELATIONSHIP function&lt;/STRONG&gt; is used to activate an inactive relationship, and the arguments are the two columns that make up the relationship.&lt;/P&gt;
&lt;P&gt;You can read this two documents for a further study:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/related-function-dax" target="_blank"&gt;RELATED function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/userelationship-function-dax" target="_blank"&gt;USERELATIONSHIP function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: 6.0pt;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 08:35:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/3735831#M145613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-01T08:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use RELATED with USERELATIONSHIP or something similar to use an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/4071528#M161623</link>
      <description>&lt;P&gt;I'm popping in way after you posted this solution to say, thanks! This helped me work out something in my report.&lt;BR /&gt;&lt;BR /&gt;Only thing is I had to add a second filter condition to the Calculate, something like&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;'Category Table'[CODE]=SelectedCategory. Otherwise I was getting an array instead of one value.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:15:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-RELATED-with-USERELATIONSHIP-or-something-similar-to-use-an/m-p/4071528#M161623</guid>
      <dc:creator>Sandra_aaA</dc:creator>
      <dc:date>2024-07-31T14:15:00Z</dc:date>
    </item>
  </channel>
</rss>

