<?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: Calculating amount by voucher with cut off date not working properly in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4120243#M163585</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="785426" data-lia-user-login="ahadkarimi" class="lia-mention lia-mention-user"&gt;ahadkarimi&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this solution and it did not work....&lt;/P&gt;&lt;P&gt;As you can see below it shows records for CHF whereas this Source Entity does not have any records in CHF and it shows all the different possible accounts under USD whereas only few of them have been used.&lt;/P&gt;&lt;P&gt;And the value for those lines are 0....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below is the result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data model I have a dimesion for the account (Full Description) and for the Voucher (Voucher No).&lt;/P&gt;&lt;P&gt;However, I don't have dimension for Currency and Source Entity which come directly from the factTable.&lt;/P&gt;&lt;P&gt;Could it be a problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2024 08:11:21 GMT</pubDate>
    <dc:creator>Sylvain74</dc:creator>
    <dc:date>2024-08-27T08:11:21Z</dc:date>
    <item>
      <title>Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4118950#M163525</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a fact table called factGLDetails linked to few dimension tables dimLedgerDate, dimAccount, dimVoucher.&lt;/P&gt;&lt;P&gt;The fact table represents a ledger details where each line can be a voucher or a payment.&amp;nbsp; When this a payment I know to which voucher(s) it is applied. My objective is to calculate the Voucher Amount (only lines which are of type vouchers, excluding lines of type payment), calculate the Paid Amount (only line of type payment) and calculating an open amount. All these 3 measures should be calcualted by voucher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To do so I wrote the below DAX expression:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below is an extract of the Journal Ledger:&lt;/P&gt;&lt;P&gt;For example we see that for voucher DM-315, the Voucher amount is 183.09, the payment PAY-582 has been made for 183.09 and therefore the Open Amount should be 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I display a matrix showing that, I don't have the expected result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For DM-315, it's OK but PowerBI shows values for account in CHF where does not exists for the Source Entity (Counterparty), on top of that I see some Vouchers which does not belong to the Source Entity...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sure it's related to the DAX expression I wrote but I cannot figure what is incorrect?&lt;/P&gt;&lt;P&gt;Can you please help me ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 15:31:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4118950#M163525</guid>
      <dc:creator>Sylvain74</dc:creator>
      <dc:date>2024-08-26T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4119003#M163531</link>
      <description>&lt;P&gt;I wrote below measures which are working a bit better. However as soon as I add COALESCE to replace Blank value by zero, it shows a lot of other invoices not related to the current customer:&lt;/P&gt;&lt;P&gt;AMOUNT =&lt;BR /&gt;var VoucherAmt =&lt;BR /&gt;SUMX(&lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;'(FACT) GL Details',&lt;BR /&gt;('(FACT) GL Details'[SourcePurchaseVoucherDimKey] &amp;gt; 0 || '(FACT) GL Details'[SourceSaleInvoiceDimKey] &amp;gt; 0)&lt;BR /&gt;),&lt;BR /&gt;'(FACT) GL Details'[Movement FRGN]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;RETURN VoucherAmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PAID =&lt;BR /&gt;var VoucherPmt =&lt;BR /&gt;SUMX(&lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;'(FACT) GL Details',&lt;BR /&gt;('(FACT) GL Details'[SourceAPPaymentDimKey] &amp;gt; 0 || '(FACT) GL Details'[SourceARPaymentDimKey] &amp;gt; 0)&lt;BR /&gt;),&lt;BR /&gt;'(FACT) GL Details'[Movement FRGN]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;RETURN VoucherPmt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below is the results whithout handling blank values...and it looks Ok...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as soon as I try to replace blank values by 0, it gives me below result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I don't understand what I am missing... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 16:13:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4119003#M163531</guid>
      <dc:creator>Sylvain74</dc:creator>
      <dc:date>2024-08-26T16:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4119043#M163532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="931" data-lia-user-login="Sylvain74" class="lia-mention lia-mention-user"&gt;Sylvain74&lt;/a&gt;,&amp;nbsp;try two measures below, and if you encounter any issues, let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AMOUNT = 
var VoucherAmt = 
SUMX(
    CALCULATETABLE(
        '(FACT) GL Details',
        '(FACT) GL Details'[SourcePurchaseVoucherDimKey] &amp;gt; 0 || '(FACT) GL Details'[SourceSaleInvoiceDimKey] &amp;gt; 0
    ),
    '(FACT) GL Details'[Movement FRGN]
)

RETURN IF(ISBLANK(VoucherAmt), 0, VoucherAmt)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;PAID = 
var VoucherPmt = 
SUMX(
    CALCULATETABLE(
        '(FACT) GL Details',
        '(FACT) GL Details'[SourceAPPaymentDimKey] &amp;gt; 0 || '(FACT) GL Details'[SourceARPaymentDimKey] &amp;gt; 0
    ),
    '(FACT) GL Details'[Movement FRGN]
)

RETURN IF(ISBLANK(VoucherPmt), 0, VoucherPmt)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="center"&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Did I answer your question?&amp;nbsp;&lt;/STRONG&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;If so, please mark my post as the solution!&lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Your Kudos are much appreciated!&amp;nbsp;&lt;/STRONG&gt; &lt;FONT color="#99CC00"&gt;&lt;STRONG&gt;Proud to be a Responsive Resident!&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2024 16:19:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4119043#M163532</guid>
      <dc:creator>ahadkarimi</dc:creator>
      <dc:date>2024-08-26T16:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4120243#M163585</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="785426" data-lia-user-login="ahadkarimi" class="lia-mention lia-mention-user"&gt;ahadkarimi&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this solution and it did not work....&lt;/P&gt;&lt;P&gt;As you can see below it shows records for CHF whereas this Source Entity does not have any records in CHF and it shows all the different possible accounts under USD whereas only few of them have been used.&lt;/P&gt;&lt;P&gt;And the value for those lines are 0....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here below is the result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data model I have a dimesion for the account (Full Description) and for the Voucher (Voucher No).&lt;/P&gt;&lt;P&gt;However, I don't have dimension for Currency and Source Entity which come directly from the factTable.&lt;/P&gt;&lt;P&gt;Could it be a problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2024 08:11:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4120243#M163585</guid>
      <dc:creator>Sylvain74</dc:creator>
      <dc:date>2024-08-27T08:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4122034#M163667</link>
      <description>&lt;P&gt;Any help would be very welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 06:24:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4122034#M163667</guid>
      <dc:creator>Sylvain74</dc:creator>
      <dc:date>2024-08-28T06:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating amount by voucher with cut off date not working properly</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4123429#M163735</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Unfortunately it does not work...&lt;/P&gt;&lt;P&gt;In my data model I have a dimesion for the account (Full Description) and for the Voucher (Voucher No).&lt;/P&gt;&lt;P&gt;However, I don't have dimension for Currency and Source Entity which come directly from the factTable.&lt;/P&gt;&lt;P&gt;Could it be a problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 19:38:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-amount-by-voucher-with-cut-off-date-not-working/m-p/4123429#M163735</guid>
      <dc:creator>Sylvain74</dc:creator>
      <dc:date>2024-08-28T19:38:49Z</dc:date>
    </item>
  </channel>
</rss>

