<?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: Percentage difference between current year sale ytd &amp;amp; previous year ytd in a card visual. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2300278#M56799</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;SALES YTD =
SUMX(
    FILTER(
        ALL( 'table' ),
        [fiscal year] = MAX( 'table'[fiscal year] )
            &amp;amp;&amp;amp; [date] &amp;lt;= MAX( 'table'[date] )
    ),
    [Sales]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="ruby"&gt;SALES LYYTD =
SUMX(
    FILTER(
        ALL( 'table' ),
        [fiscal year]
            = MAX( 'table'[fiscal year] ) - 1
            &amp;amp;&amp;amp; [date] &amp;lt;= EDATE( MAX( 'table'[date] ), -12 )
    ),
    [Sales]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="ruby"&gt;diff =
DIVIDE( [SALES YTD] - [SALES LYYTD], [SALES YTD] )
&lt;/LI-CODE&gt;
&lt;P&gt;Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More information about time-related calculations:&lt;BR /&gt;&lt;A href="https://www.daxpatterns.com/standard-time-related-calculations/" target="_self"&gt;Standard time-related calculations&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Zeon Zheng&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&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;/P&gt;</description>
    <pubDate>Tue, 25 Jan 2022 07:11:25 GMT</pubDate>
    <dc:creator>v-angzheng-msft</dc:creator>
    <dc:date>2022-01-25T07:11:25Z</dc:date>
    <item>
      <title>Percentage difference between current year sale ytd &amp; previous year ytd in a card visual.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296560#M56614</link>
      <description>&lt;P&gt;Hi everyone.&lt;BR /&gt;So i want to calculate % difference between CY_YTD &amp;amp; PY_YTD and show the total % diff in a card visual. Keeping in mind that fiscal years starts at december. i have sale column available.&lt;BR /&gt;Kindly let me know how to do it in a dax.&lt;BR /&gt;Thanks in advance to this wonderful community.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 12:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296560#M56614</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-22T12:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between current year sale ytd &amp; previous year ytd in a card visual.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296573#M56616</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;So based on your description here is the dax you need:&lt;BR /&gt;&lt;BR /&gt;For YTD:&lt;BR /&gt;[SALES YTD]=&lt;BR /&gt;CALCULATE(SUM('Table'[Sales]),DATESYTD('Calendar'[Date],"11/30")) //"11/30" is the year end date&lt;BR /&gt;&lt;BR /&gt;For LYYTD:&lt;BR /&gt;[SALES LYYTD]&lt;BR /&gt;CALCULATE([SALES YTD],SAMEPERIODLASTYEAR('Calendar'[Date]))&lt;BR /&gt;&lt;BR /&gt;For diff %:&lt;BR /&gt;[SALES YTD-SALES LYYTD diff]=&lt;BR /&gt;DIVIDE([SALES YTD]-[SALES LYYTD],[SALES YTD])&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 13:16:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296573#M56616</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-22T13:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between current year sale ytd &amp; previous year ytd in a card visual.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296595#M56619</link>
      <description>&lt;P&gt;I am unable to show it in the card. Card shows (blank). How can i show the total % diff in a card visual.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 14:16:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296595#M56619</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-22T14:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between current year sale ytd &amp; previous year ytd in a card visual.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296630#M56622</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Did you have a month selected?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;E.g. with selection:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Without:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 15:58:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2296630#M56622</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-22T15:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage difference between current year sale ytd &amp; previous year ytd in a card visual.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2300278#M56799</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;LI-CODE lang="ruby"&gt;SALES YTD =
SUMX(
    FILTER(
        ALL( 'table' ),
        [fiscal year] = MAX( 'table'[fiscal year] )
            &amp;amp;&amp;amp; [date] &amp;lt;= MAX( 'table'[date] )
    ),
    [Sales]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="ruby"&gt;SALES LYYTD =
SUMX(
    FILTER(
        ALL( 'table' ),
        [fiscal year]
            = MAX( 'table'[fiscal year] ) - 1
            &amp;amp;&amp;amp; [date] &amp;lt;= EDATE( MAX( 'table'[date] ), -12 )
    ),
    [Sales]
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="ruby"&gt;diff =
DIVIDE( [SALES YTD] - [SALES LYYTD], [SALES YTD] )
&lt;/LI-CODE&gt;
&lt;P&gt;Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More information about time-related calculations:&lt;BR /&gt;&lt;A href="https://www.daxpatterns.com/standard-time-related-calculations/" target="_self"&gt;Standard time-related calculations&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ Zeon Zheng&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&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;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 07:11:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percentage-difference-between-current-year-sale-ytd-amp-previous/m-p/2300278#M56799</guid>
      <dc:creator>v-angzheng-msft</dc:creator>
      <dc:date>2022-01-25T07:11:25Z</dc:date>
    </item>
  </channel>
</rss>

