<?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: How to display Grand Total correctly with USERELATIONSHIP? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282011#M121921</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;calcEmails :=&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Fact'[Fact.agentId] ),&lt;BR /&gt;COALESCE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jun 2023 15:12:47 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2023-06-13T15:12:47Z</dc:date>
    <item>
      <title>How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3281995#M121919</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Good day,&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I’m having trouble with getting the correct Grand Total for my pivot table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have two tables.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Fact table of email worked by an employee. It has a &lt;STRONG&gt;pkey&lt;/STRONG&gt; column which is just a concatenation of week and agentId.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Dimension table that has the login data of employee. It has an active citrixKey connected to Fact table.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;In general, Fact.agentId is the same as Dimension.citrixUsername, however an employee encountered issues with the citrixUsername and is now using Dimension.ntLogin. When I tried to build a pivot table with rows as agentId and values as sum of values, the grand total is not correct.&lt;BR /&gt;&lt;BR /&gt;Here are my measures:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;sumEmails:=&lt;/DIV&gt;&lt;DIV&gt;SUM( 'Fact'[Value] )&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;calcEmails:=&lt;/DIV&gt;&lt;DIV&gt;IF(&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[sumEmails] = BLANK(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[sumEmails],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;USERELATIONSHIP('Fact'[pkey], 'Dimension'[ntloginKey])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[sumEmails]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;)&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A title="Sample" href="https://1drv.ms/x/s!ArT3ks2QJpRMoF_jsz0uw8U6Op-J?e=qF7NgB" target="_blank" rel="noopener"&gt;Sample&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 15:01:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3281995#M121919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-13T15:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282011#M121921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try&lt;/P&gt;
&lt;P&gt;calcEmails :=&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Fact'[Fact.agentId] ),&lt;BR /&gt;COALESCE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 15:12:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282011#M121921</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-13T15:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282208#M121929</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, thanks for the input. i am using excel. and it seems coalesce is not available.&lt;BR /&gt;&lt;BR /&gt;Failed to resolve name 'COALESCE'. It is not a valid table, variable, or function name.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:50:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282208#M121929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-13T17:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282212#M121930</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then try&lt;/P&gt;
&lt;P&gt;calcEmails :=&lt;BR /&gt;SUMX (&lt;BR /&gt;VALUES ( 'Fact'[Fact.agentId] ),&lt;BR /&gt;VAR SumEmails = [sumEmails]&lt;BR /&gt;RETURN&lt;BR /&gt;IF (&lt;BR /&gt;ISBLANK ( sumEmails ),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;BR /&gt;),&lt;BR /&gt;sumEmails&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 17:53:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282212#M121930</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-13T17:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282230#M121932</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, i tried the revised measure. however, it only shows the data for week 6/4/23. it does not show the data of&amp;nbsp;ceb1ccabalquinto(ntloginKey) on week 6/11/23.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 18:05:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282230#M121932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-06-13T18:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to display Grand Total correctly with USERELATIONSHIP?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282312#M121937</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may try something complex like&lt;/P&gt;
&lt;P&gt;calcEmails :=&lt;BR /&gt;SUMX (&lt;BR /&gt;DISTINCT (&lt;BR /&gt;UNION (&lt;BR /&gt;VALUES ( 'Fact'[Fact.agentId] ),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;VALUES ( 'Fact'[Fact.agentId] ),&lt;BR /&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;VAR SumEmails = [sumEmails]&lt;BR /&gt;RETURN&lt;BR /&gt;IF (&lt;BR /&gt;ISBLANK ( sumEmails ),&lt;BR /&gt;CALCULATE (&lt;BR /&gt;[sumEmails],&lt;BR /&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;BR /&gt;),&lt;BR /&gt;sumEmails&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or could something just simple as&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;calcEmails :=&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[sumEmails],&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;USERELATIONSHIP ( 'Fact'[pkey], 'Dimension'[ntloginKey] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+ [sumEmails]&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2023 19:02:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-display-Grand-Total-correctly-with-USERELATIONSHIP/m-p/3282312#M121937</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-06-13T19:02:58Z</dc:date>
    </item>
  </channel>
</rss>

