<?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 Calculate fiscal QTD amount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fiscal-QTD-amount/m-p/3166318#M113890</link>
    <description>&lt;P&gt;Need help in getting Fiscal QTD calculations, My fiscal calendar starts from June , I need to calculate QTD dynamically. As you can see below for the Calendar QTD it should show $159,411,930.304 but for the fiscal QTD it should show $104,953,597.637&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 31 Mar 2023 16:54:33 GMT</pubDate>
    <dc:creator>sekharsahu25</dc:creator>
    <dc:date>2023-03-31T16:54:33Z</dc:date>
    <item>
      <title>Calculate fiscal QTD amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fiscal-QTD-amount/m-p/3166318#M113890</link>
      <description>&lt;P&gt;Need help in getting Fiscal QTD calculations, My fiscal calendar starts from June , I need to calculate QTD dynamically. As you can see below for the Calendar QTD it should show $159,411,930.304 but for the fiscal QTD it should show $104,953,597.637&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 16:54:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fiscal-QTD-amount/m-p/3166318#M113890</guid>
      <dc:creator>sekharsahu25</dc:creator>
      <dc:date>2023-03-31T16:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate fiscal QTD amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fiscal-QTD-amount/m-p/3175686#M114627</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="282631" data-lia-user-login="sekharsahu25" class="lia-mention lia-mention-user"&gt;sekharsahu25&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to create a calendar table by my code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calendar = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "YearMonth",
        YEAR ( [Date] ) * 100
            + MONTH ( [Date] ),
    "Calendar QTD",
        "Qtr" &amp;amp; " "
            &amp;amp; QUARTER ( [Date] ),
    "Fiscal QTD",
        VAR _START =
            EOMONTH ( [Date], -6 ) + 1
        RETURN
            "Q" &amp;amp; " "
                &amp;amp; QUARTER ( _START ),
    "Year Calendar QTD",
        YEAR ( [Date] ) * 100
            + QUARTER ( [Date] ),
    "Year Fiscal QTD",
        VAR _START =
            EOMONTH ( [Date], -6 ) + 1
        RETURN
            IF (
                MONTH ( [Date] ) &amp;gt;= 6,
                YEAR ( [Date] ) * 100
                    + QUARTER ( _START ),
                ( YEAR ( [Date] ) - 1 ) * 100
                    + QUARTER ( _START )
            )
)&lt;/LI-CODE&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Amount = 
VAR _CURRENT =
    CALCULATE (
        MAX ( 'Calendar'[Year Fiscal QTD] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] = TODAY () )
    )
VAR _QTDAmount =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( ALL ( 'Calendar' ), 'Calendar'[Year Fiscal QTD] = _CURRENT )
    )
VAR _Amount =
    CALCULATE ( SUM ( 'Table'[Amount] ) )
RETURN
    IF (
        HASONEVALUE ( 'Calendar'[Fiscal QTD] ),
        IF ( NOT ( ISBLANK ( _Amount ) ), _Amount, BLANK () ),
        _QTDAmount
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 09:54:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-fiscal-QTD-amount/m-p/3175686#M114627</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-06T09:54:36Z</dc:date>
    </item>
  </channel>
</rss>

