<?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: SSAS Tabular - Default Detail Rows Expression in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766560#M3479</link>
    <description>You have to change the relationship via a combination of CALCULATE and USERELATIONSHIP. But be careful where you do it. RELATED must work AFTER the relationship has been activated, not before.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
    <pubDate>Wed, 14 Aug 2019 14:09:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-14T14:09:28Z</dc:date>
    <item>
      <title>SSAS Tabular - Default Detail Rows Expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766397#M3471</link>
      <description>&lt;P&gt;For a SSAS 2017 tabular model surfaced via pivot tables, a handy (vital) feature is the ability to drill through to a sensible selection of detail rows via double click on a measure (just like in the old school Excel pivot tables that your finance department can't part with). The content of the drillthough is determined by the table property [Default Detail Rows Expression]. The example Microsoft provides&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/sql/analysis-services/what-s-new-in-sql-server-analysis-services-2017?view=sql-server-2017" target="_blank" rel="nofollow noopener noreferrer"&gt;here&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is great insofar as it goes.&lt;/P&gt;&lt;PRE&gt;SELECTCOLUMNS(
    'Internet Sales',
    "Customer First Name", RELATED( Customer[Last Name]),
    "Customer Last Name", RELATED( Customer[First Name]),
    "Order Date", 'Internet Sales'[Order Date],
    "Internet Total Sales", [Internet Total Sales]
)&lt;/PRE&gt;&lt;P&gt;My problem is that I have a calendar table with an active relationship with my fact table (let's call this fact column&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;end_date_sk) and an inactive relationship with the same table (let's call this fact column&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;start_date_sk). If I want to return calendar columns from both the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;inactive&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;active&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;relationships, what do I do?&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;RELATED()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;only seems to work for the active relationship.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 11:50:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766397#M3471</guid>
      <dc:creator>CrassJoin</dc:creator>
      <dc:date>2019-08-14T11:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: SSAS Tabular - Default Detail Rows Expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766560#M3479</link>
      <description>You have to change the relationship via a combination of CALCULATE and USERELATIONSHIP. But be careful where you do it. RELATED must work AFTER the relationship has been activated, not before.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;Darek</description>
      <pubDate>Wed, 14 Aug 2019 14:09:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766560#M3479</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-14T14:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: SSAS Tabular - Default Detail Rows Expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766945#M3497</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you link to an example of this? I tried USERELATIONSHIP with no joy.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 21:48:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/766945#M3497</guid>
      <dc:creator>CrassJoin</dc:creator>
      <dc:date>2019-08-14T21:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: SSAS Tabular - Default Detail Rows Expression</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/767383#M3505</link>
      <description>&lt;P&gt;Using RELATED(TABLE) is tricky with inactive relationships. Here's the code you're after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;New Table = 
SELECTCOLUMNS(
    'Fact',
    "Value For Column 1", RELATED( Dim[Value] ),
    "Value For Column 2",
        CALCULATE (
            CALCULATE (
                VALUES ( Dim[Value] ),
                'Fact'
            ),
            USERELATIONSHIP ( Dim[Column], 'Fact'[Column 2] ),
            ALL ( Dim )
        )
)&lt;/PRE&gt;
&lt;P&gt;Assumptions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Fact is the fact table with 2 columns, Column 1 and Column 2. Both join on Column to Dim.&lt;/LI&gt;
&lt;LI&gt;Dim is a dimension table with Column and Value.&lt;/LI&gt;
&lt;LI&gt;The above retrieves the Value for Column 1 and Column 2 for each of of the rows in Fact.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;If you want to know why so, please go to &lt;A href="https://www.sqlbi.com/articles/userelationship-in-calculated-columns/" target="_self"&gt;this article&lt;/A&gt; and read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 09:09:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SSAS-Tabular-Default-Detail-Rows-Expression/m-p/767383#M3505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-15T09:09:57Z</dc:date>
    </item>
  </channel>
</rss>

