<?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: Help on DAX: Calculate, All, Selectedvalue, Userelationship in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3832197#M149845</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="722358" data-lia-user-login="Vietle111" class="lia-mention lia-mention-user"&gt;Vietle111&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, please &lt;SPAN&gt;try the following DAX formula:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Counterparty Pre =
VAR ExcludePL = SELECTEDVALUE('0-PL List'[PL Account])
RETURN
CALCULATE(
    SUM('2. PL Entry'[Base Amount]),
    FILTER(
        ALL('2. PL Entry'),
        '2. PL Entry'[Account Code] &amp;lt;&amp;gt; ExcludePL
    ),
    USERELATIONSHIP('0-PL Period Compare'[Period], '2. PL Entry'[Period])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;View the following documents to learn about dax function.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/all-function-dax" target="_blank"&gt;ALL function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&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;If the above ones can’t help you get it working, c&lt;SPAN&gt;ould you please provide &lt;/SPAN&gt;more raw data(exclude sensitive data) with Text format &lt;SPAN&gt;to make a deep troubleshooting? &lt;/SPAN&gt;It would be helpful to find out the solution.&lt;/P&gt;
&lt;P&gt;You can refer the following links to share the information:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2024 02:17:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-12T02:17:31Z</dc:date>
    <item>
      <title>Help on DAX: Calculate, All, Selectedvalue, Userelationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3830278#M149756</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I create 2 period columns for quarter comparison over years for my accounting report. Ideally, every entry record has a pair of both Debit &amp;amp; Credit. So when I select an acount in Debit, then another table will show Credit - (to find its counterparty: I use DAX: &amp;lt;&amp;gt;selectedvalue)&lt;/P&gt;&lt;P&gt;This is my current model&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have these formulas:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;U&gt;This works for me: to find counterparty of The First Period (Period 1)&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;Counterparty = &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt;&lt;SPAN&gt; ExcludePL=&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('0-PL List'[PL Account])&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;('2. PL Entry'[Base Amount]),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;('2. PL Entry','2. PL Entry'[Account Code]&amp;lt;&amp;gt;ExcludePL),&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;TREATAS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;('0-PL Period'[Period]),'2. PL Entry'[Period]))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;This doesn't work: I am trying to find counterparty for Second Period (period 2)&lt;/U&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Counterparty Pre =&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;ExcludePL&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'0-PL List'&lt;/SPAN&gt;&lt;SPAN&gt;[PL Account]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'2. PL Entry'&lt;/SPAN&gt;&lt;SPAN&gt;[Base Amount]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'0-PL Period'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'0-PL Period Compare'&lt;/SPAN&gt;&lt;SPAN&gt;[Period]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'2. PL Entry'&lt;/SPAN&gt;&lt;SPAN&gt;[Period]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'2. PL Entry'&lt;/SPAN&gt;&lt;SPAN&gt;[Account Code]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;ExcludePL&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img /&gt;&lt;P&gt; I tried different ways to write DAX for second period: result can be 0 or dupicate each value of subtotal. Please help me to review above formula.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Apr 2024 09:28:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3830278#M149756</guid>
      <dc:creator>Vietle111</dc:creator>
      <dc:date>2024-04-11T09:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help on DAX: Calculate, All, Selectedvalue, Userelationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3832197#M149845</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="722358" data-lia-user-login="Vietle111" class="lia-mention lia-mention-user"&gt;Vietle111&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, please &lt;SPAN&gt;try the following DAX formula:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Counterparty Pre =
VAR ExcludePL = SELECTEDVALUE('0-PL List'[PL Account])
RETURN
CALCULATE(
    SUM('2. PL Entry'[Base Amount]),
    FILTER(
        ALL('2. PL Entry'),
        '2. PL Entry'[Account Code] &amp;lt;&amp;gt; ExcludePL
    ),
    USERELATIONSHIP('0-PL Period Compare'[Period], '2. PL Entry'[Period])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;View the following documents to learn about dax function.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/all-function-dax" target="_blank"&gt;ALL function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&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;If the above ones can’t help you get it working, c&lt;SPAN&gt;ould you please provide &lt;/SPAN&gt;more raw data(exclude sensitive data) with Text format &lt;SPAN&gt;to make a deep troubleshooting? &lt;/SPAN&gt;It would be helpful to find out the solution.&lt;/P&gt;
&lt;P&gt;You can refer the following links to share the information:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2024 02:17:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3832197#M149845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-12T02:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help on DAX: Calculate, All, Selectedvalue, Userelationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3841275#M150170</link>
      <description>&lt;P&gt;Hi Wu,&lt;/P&gt;&lt;P&gt;I tried the fomular you provided but it returns blank instead. Figuring out the way to provide dataset after removing all sensitive data.&lt;BR /&gt;I'll back to you soon.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 11:46:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3841275#M150170</guid>
      <dc:creator>Vietle111</dc:creator>
      <dc:date>2024-04-16T11:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help on DAX: Calculate, All, Selectedvalue, Userelationship</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3846141#M150320</link>
      <description>&lt;P&gt;Hi Wu,&lt;BR /&gt;&lt;BR /&gt;I created a copy of data, so please help me to revise Dax fomular Counterparty of Previous period. Thanks&lt;BR /&gt;&lt;A href="https://www.dropbox.com/t/o3pPuqpTKGBF4uR5" target="_self"&gt;https://www.dropbox.com/t/o3pPuqpTKGBF4uR5&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 15:25:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-on-DAX-Calculate-All-Selectedvalue-Userelationship/m-p/3846141#M150320</guid>
      <dc:creator>Vietle111</dc:creator>
      <dc:date>2024-04-17T15:25:06Z</dc:date>
    </item>
  </channel>
</rss>

