<?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: TREATAS vs USERELATIONSHIP - Both incorrect?! in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1408165#M26055</link>
    <description>&lt;P&gt;Your treatas formula is back to front&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Keyword"&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword"&gt;VALUES&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Transactional[Profile&amp;nbsp;Activity&amp;nbsp;Owner&amp;nbsp;ID]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Person[SRC_PRSN_HIST_GEN_ID]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Parenthesis"&gt;have a read of my article here&amp;nbsp;&lt;A href="https://exceleratorbi.com.au/virtual-filters-using-treatas/" target="_blank"&gt;https://exceleratorbi.com.au/virtual-filters-using-treatas/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2020 20:56:43 GMT</pubDate>
    <dc:creator>MattAllington</dc:creator>
    <dc:date>2020-10-01T20:56:43Z</dc:date>
    <item>
      <title>TREATAS vs USERELATIONSHIP - Both incorrect?!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1408056#M26051</link>
      <description>&lt;P&gt;Can anyone explain the differences between TREATAS and USERELATIONSHIP in a practical application? The key difference as far as I can tell is USERELATIONSHIP needs an inactive relationship defined in the model to work.&lt;BR /&gt;&lt;BR /&gt;There's also some other difference that I'm not able to pin down, but the same calculation using USERELATIONSHIP and TREATAS results in completely different results. For example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE 
MEASURE Transactional[test_taskJoin2] = CALCULATE(DISTINCTCOUNT(Transactional[Profile Task Id]) , TREATAS( VALUES(Transactional[Profile Activity Owner ID]), Person[SRC_PRSN_HIST_GEN_ID]))
MEASURE Transactional[test_taskJoin] = CALCULATE([Transactional Open], USERELATIONSHIP( Transactional[Profile Activity Owner ID], Person[SRC_PRSN_HIST_GEN_ID]))
EVALUATE

SUMMARIZE(
Transactional, Person[Level 2 Manager]
,"Test (UseRelationship)",Transactional[test_taskJoin]
,"Test (TreatAs)", Transactional[test_taskJoin2]
)
ORDER BY 
Transactional[test_taskJoin] desc&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Results in:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;Then at the transactional level, filtering to a single L2 Manager (The fourth one down from the top) TREATAS matches what USERELATIONSHIP rolls up to, but USERELATIONSHIP doesn't match itself.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
MEASURE Transactional[test_taskJoin] = CALCULATE([Transactional Open], USERELATIONSHIP( Transactional[Profile Activity Owner ID], Person[SRC_PRSN_HIST_GEN_ID])) 
MEASURE Transactional[test_taskJoin2] = CALCULATE([Transactional Open], TREATAS( VALUES(Transactional[Profile Activity Owner ID]), Person[SRC_PRSN_HIST_GEN_ID]) ) 

VAR __DS0FilterTable = 
TREATAS( 
{"L2 Manager Name" 
}, 
Person[Level 2 Manager] 
) 

VAR __DS0Core = 
SUMMARIZECOLUMNS( 
Agent[Agent Name], 
Transactional[Profile Task Id], 
Transactional[Case], 
__DS0FilterTable, 
"Test Task (UseRelationship)", Transactional[test_taskJoin], 
"Test Task (TreatAS)", Transactional[test_taskJoin2] 
) 

EVALUATE 
__DS0Core&lt;/LI-CODE&gt;&lt;P&gt;Summing the two measures at the transactional level in excel ends up with:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am completely confused as to why neither of these methods seem consistent or accurate.&lt;/P&gt;&lt;P&gt;Any insight would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 19:23:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1408056#M26051</guid>
      <dc:creator>scriptpup</dc:creator>
      <dc:date>2020-10-01T19:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS vs USERELATIONSHIP - Both incorrect?!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1408165#M26055</link>
      <description>&lt;P&gt;Your treatas formula is back to front&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Keyword"&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Keyword"&gt;VALUES&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Transactional[Profile&amp;nbsp;Activity&amp;nbsp;Owner&amp;nbsp;ID]&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Person[SRC_PRSN_HIST_GEN_ID]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent8"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="Parenthesis"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Parenthesis"&gt;have a read of my article here&amp;nbsp;&lt;A href="https://exceleratorbi.com.au/virtual-filters-using-treatas/" target="_blank"&gt;https://exceleratorbi.com.au/virtual-filters-using-treatas/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 20:56:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1408165#M26055</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2020-10-01T20:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS vs USERELATIONSHIP - Both incorrect?!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1409768#M26106</link>
      <description>&lt;P&gt;Hi Matt,&lt;BR /&gt;&lt;BR /&gt;My mistake with the pasted formula, I actually tried it both ways but it comes back with the same results regardless of which sides I use.&lt;BR /&gt;&lt;BR /&gt;I've read that column in the past, and several others that are similar. The problem I'm having is I don't understand why the two functions would result in something completely different with the same filter-set, same relationship defined, and neither of them are correct.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 14:29:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1409768#M26106</guid>
      <dc:creator>scriptpup</dc:creator>
      <dc:date>2020-10-02T14:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS vs USERELATIONSHIP - Both incorrect?!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1410380#M26130</link>
      <description>&lt;P&gt;I stopped looking after I saw the first issue. I would doubt if summarize or SUMMARIZECOLUMNS are appropriate in this case. Both of these functions leverage the existing active physical relationships in the model to build the starting table. I suggest you don't use either of these functions and build the table yourself instead. Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DEFINE
    MEASURE Transactional[test_taskJoin2] =
        CALCULATE (
            DISTINCTCOUNT ( Transactional[Profile Task Id] ),
            TREATAS (
                VALUES ( Person[SRC_PRSN_HIST_GEN_ID] ),
                Transactional[Profile Activity Owner ID],
                Person[SRC_PRSN_HIST_GEN_ID]
            )
        )
    MEASURE Transactional[test_taskJoin] =
        CALCULATE (
            [Transactional Open],
            USERELATIONSHIP ( Transactional[Profile Activity Owner ID], Person[SRC_PRSN_HIST_GEN_ID] )
        )
EVALUATE
ADDCOLUMNS (
    ALL ( Person[Level 2 Manager] ),
    "Test (UseRelationship)", Transactional[test_taskJoin],
    "Test (TreatAs)", Transactional[test_taskJoin2]
)
ORDER BY Transactional[test_taskJoin] DESC&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 20:03:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1410380#M26130</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2020-10-02T20:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: TREATAS vs USERELATIONSHIP - Both incorrect?!</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1410652#M26141</link>
      <description>&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="157903" data-lia-user-login="scriptpup" class="lia-mention lia-mention-user"&gt;scriptpup&lt;/a&gt; can you post your Power BI file or the snapshot of the diagram view?</description>
      <pubDate>Sat, 03 Oct 2020 05:54:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/TREATAS-vs-USERELATIONSHIP-Both-incorrect/m-p/1410652#M26141</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-10-03T05:54:32Z</dc:date>
    </item>
  </channel>
</rss>

