<?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: DAX using USERELATIONSHIP is not working for an inactive relationship in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521514#M29686</link>
    <description>&lt;P&gt;It isn't working because you have ambiguity in the model. Hard to see exactly how it is flowing, but it appears to be this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get rid of those bi-directional relationships and see how it goes.&amp;nbsp;Microsoft recommends minimizing use of both Many-to-Many and Bi-Directional Relationships. In other words, unless you are a DAX expert, find another way to remodel your data to conform to a Star Schema and don't use these two features. I avoid them both at all costs.&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/relationships-many-to-many" rel="noopener" target="_blank"&gt;Microsoft Guidance on Many-To-Many Relationships&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/relationships-bidirectional-filtering" rel="noopener" target="_blank"&gt;Microsoft Guidance on Bi-Directional Relationships&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/star-schema" rel="noopener" target="_blank"&gt;Microsoft Guidance on Importance of Star Schema&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could -&amp;nbsp;&lt;EM&gt;could&lt;/EM&gt; - try turning off the bi-di in measures by using CROSSFILTER(table1[field], table2[field], ONE) (or NONE to just disable the relationship) but your best bet is get rid of all of the bi-di and only turn it on in ither measures via CROSSFILTER.&lt;BR /&gt;&lt;BR /&gt;THe first thing I do when someone asks for my help with a model that has any bi-directional relationships is copy the file, turn them all back to single, then tweak measures and slicers to work as if they had bi-di turned on by only turning them on in measures, almost never ever in the model itself.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 21:39:38 GMT</pubDate>
    <dc:creator>edhans</dc:creator>
    <dc:date>2020-11-27T21:39:38Z</dc:date>
    <item>
      <title>DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521480#M29681</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt; Dim_LaborShift&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table2:&lt;/STRONG&gt; Fact_HoursPlanner&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;P&gt;&lt;STRONG&gt;Data model:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create &lt;STRONG&gt;matrix&lt;/STRONG&gt; which shows "Total Shift Length" for a particular &lt;U&gt;User&lt;/U&gt; on a particular &lt;U&gt;Date&lt;/U&gt;. As you can see from the data model, I have an &lt;STRONG&gt;INACTIVE&lt;/STRONG&gt; relationship between &lt;EM&gt;"Name"&lt;/EM&gt; (Dim_LaborShift) and &lt;EM&gt;"TEXT_VAL"&lt;/EM&gt; (Fact_HoursPlanner) and I am using this relationship in the following DAX with USERELATIONSHIP to establish the relation but it is summing all ShiftLengths in the Dim_LaborShift table and populating those for ALL Users on ALL Dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, in the matrix I want to show only values where the User has been assigned one/more Shift(s) and the Total Length of those shift(s) for a given date. Per the example in the screenshot, it should be:&lt;BR /&gt;Matrix:&lt;BR /&gt;&lt;STRONG&gt;User: 11/21/20 | 11/22/20 | 11/23/20 | 11/24/20 | 11/25/20 | 11/26/20 | 11/27/20&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1457178 : 15.5 (i.e 7.5 + 8.00) | | | | | | |&lt;/P&gt;&lt;P&gt;295949: 5 | | | | | | |&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;DAX usage:&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;SPAN&gt;Total Shift Length = CALCULATE(SUM('OLAP LPP_Dim_LaborShift'[ShiftLength]),&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP('OLAP LPP_Dim_LaborShift'[Name], &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'OLAP CUBE_LPP_Fact_HoursPlanner_WB'[TEXT_VAL]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not quite sure why USERELATIONSHIP isn't working here and ANY help/guidance in achieving the above result would be great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 21:06:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521480#M29681</guid>
      <dc:creator>RavitPBI</dc:creator>
      <dc:date>2020-11-27T21:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521490#M29682</link>
      <description>&lt;P&gt;This model doesn't look good. It's ambiguous (I can say this at first sight), so I wouldn't trust a single figure you get from it. If you try to enable the inactive relationship, one of the tables will immediately be able to be filtered from another table via 2 different paths and this is probably why the engine does "strange" things. If I were you, I'd deeply re-think the model and stick religiously to a proper star schema with no bi-dir filtering. Bi-dir filtering and inactive relationships are not something to be taken lightly. They can create all sorts of problems in a badly designed model. Your model certainly is ambiguous when you try to enable the inactive relationship.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 21:16:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521490#M29682</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2020-11-27T21:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521514#M29686</link>
      <description>&lt;P&gt;It isn't working because you have ambiguity in the model. Hard to see exactly how it is flowing, but it appears to be this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get rid of those bi-directional relationships and see how it goes.&amp;nbsp;Microsoft recommends minimizing use of both Many-to-Many and Bi-Directional Relationships. In other words, unless you are a DAX expert, find another way to remodel your data to conform to a Star Schema and don't use these two features. I avoid them both at all costs.&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/relationships-many-to-many" rel="noopener" target="_blank"&gt;Microsoft Guidance on Many-To-Many Relationships&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/relationships-bidirectional-filtering" rel="noopener" target="_blank"&gt;Microsoft Guidance on Bi-Directional Relationships&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/star-schema" rel="noopener" target="_blank"&gt;Microsoft Guidance on Importance of Star Schema&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could -&amp;nbsp;&lt;EM&gt;could&lt;/EM&gt; - try turning off the bi-di in measures by using CROSSFILTER(table1[field], table2[field], ONE) (or NONE to just disable the relationship) but your best bet is get rid of all of the bi-di and only turn it on in ither measures via CROSSFILTER.&lt;BR /&gt;&lt;BR /&gt;THe first thing I do when someone asks for my help with a model that has any bi-directional relationships is copy the file, turn them all back to single, then tweak measures and slicers to work as if they had bi-di turned on by only turning them on in measures, almost never ever in the model itself.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 21:39:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1521514#M29686</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-27T21:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1522189#M29711</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24715" data-lia-user-login="edhans" class="lia-mention lia-mention-user"&gt;edhans&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for the response! Yes, you are correct in identifying the flow in the data model (blue arrows). I agree the usage of bi-dir, many-to-many and/or inactive relations should be sparingly used (even if one is a DAX expert), however, the reason I have bi-directional relations between (Dim_LaborShift, Dim_Organization) and also (Fact_HoursPlanner, Dim_User) is because I am trying to implement Row-Level Security in the model &lt;EM&gt;(see Dim_UserRLS)&lt;/EM&gt; and I am trying to use Dim_UserRLS to filter out [based on the flow]&amp;nbsp;&lt;STRONG&gt;Dim_LaborShift --&amp;gt; Dim_Organization --&amp;gt; Fact_HoursPlanner --&amp;gt; Dim_User &lt;/STRONG&gt;so the user only sees his/her organization's &amp;amp; user's data&lt;STRONG&gt;.&lt;/STRONG&gt; This is working fine, however, since I needed to have a bi-directional b/w Dim_LaborShift and Dim_Organization, I had to change the relationship between Dim_LaborShift and Fact_HoursPlanner to &lt;EM&gt;inactive&lt;/EM&gt;. Consequently, my "&lt;SPAN&gt;Total Shift Length&lt;/SPAN&gt;" DAX which was working just fine previously, isn't anymore. In my model, I need to have multiple Facts &amp;amp; Dimensions and the dimensions do not have an active relationship with other dimensions (since they already have active relationship with the Fact) which I need them to have for implementing Row-Level Security to flow through them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only option I see that avoids, both, bi-directional and inactive relations is to have &lt;STRONG&gt;multiple RLS tables&lt;/STRONG&gt; attached to the necessary dimensions to filter them down based on logged-in user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any thoughts, comments and/or suggestions would be really helpful to either resolve the DAX, or implement RLS in a better way, or a different solution altogether.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 23:00:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1522189#M29711</guid>
      <dc:creator>RavitPBI</dc:creator>
      <dc:date>2020-11-28T23:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1522190#M29712</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255913" data-lia-user-login="daxer-almighty" class="lia-mention lia-mention-user"&gt;daxer-almighty&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your inputs! As I outlined in the reply to &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24715" data-lia-user-login="edhans" class="lia-mention lia-mention-user"&gt;edhans&lt;/a&gt; - I agree the usage of bi-dir, many-to-many and/or inactive relations should be sparingly used (even if one is a DAX expert), however, the reason I have bi-directional relations between (Dim_LaborShift, Dim_Organization) and also (Fact_HoursPlanner, Dim_User) is because I am trying to implement Row-Level Security in the model&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;(see Dim_UserRLS)&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and I am trying to use Dim_UserRLS to filter out [based on the flow]&amp;nbsp;&lt;STRONG&gt;Dim_LaborShift --&amp;gt; Dim_Organization --&amp;gt; Fact_HoursPlanner --&amp;gt; Dim_User&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;so the user only sees his/her organization's &amp;amp; user's data&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;This is working fine, however, since I needed to have a bi-directional b/w Dim_LaborShift and Dim_Organization, I had to change the relationship between Dim_LaborShift and Fact_HoursPlanner to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;inactive&lt;/EM&gt;. Consequently, my "&lt;SPAN&gt;Total Shift Length&lt;/SPAN&gt;" DAX which was working just fine previously, isn't anymore. In my model, I need to have multiple Facts &amp;amp; Dimensions and the dimensions do not have an active relationship with other dimensions (since they already have active relationship with the Fact) which I need them to have for implementing Row-Level Security to flow through them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only option I see that avoids, both, bi-directional and inactive relations is to have&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;multiple RLS tables&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;attached to the necessary dimensions to filter them down based on logged-in user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Any suggestions around implementing better DAX, RLS or a different solution would be helpful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2020 23:03:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1522190#M29712</guid>
      <dc:creator>RavitPBI</dc:creator>
      <dc:date>2020-11-28T23:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524623#M29811</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;The only option I see that avoids, both, bi-directional and inactive relations is to have&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;multiple RLS tables&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;attached to the necessary dimensions to filter them down based on logged-in user.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without more info on the model and looking at it, I cannot say if that is the only option, but it sounds reasonable. And without question I would implement that strategy vs the bi-di strategy. One is a little more front end work. The latter has all sorts of side effects, that are currently causing issues and will continue to do so in the future.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:22:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524623#M29811</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-30T16:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524629#M29813</link>
      <description>&lt;P&gt;Thanks again,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24715" data-lia-user-login="edhans" class="lia-mention lia-mention-user"&gt;edhans&lt;/a&gt;,&amp;nbsp;for sharing your thoughts. I implemented the former design strategy and it is working as it should. Like you said, in the long term there is minimal-to-no risk of any surprising results with this approach.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:32:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524629#M29813</guid>
      <dc:creator>RavitPBI</dc:creator>
      <dc:date>2020-11-30T16:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX using USERELATIONSHIP is not working for an inactive relationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524669#M29816</link>
      <description>&lt;P&gt;Great&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="265954" data-lia-user-login="RavitPBI" class="lia-mention lia-mention-user"&gt;RavitPBI&lt;/a&gt;&amp;nbsp;if you could mark one or more of the responses in this thread as the "Solution" that would show others it is closed. Hope your project continues to go smoothly.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 16:52:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-using-USERELATIONSHIP-is-not-working-for-an-inactive/m-p/1524669#M29816</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-30T16:52:42Z</dc:date>
    </item>
  </channel>
</rss>

