<?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: I want to write a Dax to get Current Year and Previous day Value of Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3893570#M151773</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; and &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736848" data-lia-user-login="TRIXTERBINOOB" class="lia-mention lia-mention-user"&gt;TRIXTERBINOOB&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736663" data-lia-user-login="Ais12_" class="lia-mention lia-mention-user"&gt;Ais12_&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Year Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=YEAR(_today)),[Sales])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Current Month Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=YEAR(_today)&amp;amp;&amp;amp;MONTH('Table'[Date])=MONTH(_today)),[Sales])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous day Value Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    'Table'[Date]=_today-1),[Sales])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2024 03:44:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-05-06T03:44:56Z</dc:date>
    <item>
      <title>I want to write a Dax to get Current Year and Previous day Value of Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3889522#M151699</link>
      <description>&lt;P&gt;I want to write a Dax to get Current Year, current month and Previous day Value of Sales&lt;/P&gt;&lt;P&gt;please help me with that i want to use the same as Filter in my report&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 14:52:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3889522#M151699</guid>
      <dc:creator>Ais12_</dc:creator>
      <dc:date>2024-05-03T14:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: I want to write a Dax to get Current Year and Previous day Value of Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3889523#M151700</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736663" data-lia-user-login="Ais12_" class="lia-mention lia-mention-user"&gt;Ais12_&lt;/a&gt;&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise,&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 14:52:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3889523#M151700</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-05-03T14:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: I want to write a Dax to get Current Year and Previous day Value of Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3890197#M151720</link>
      <description>&lt;P&gt;Check out this functions:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current year: TOTALYTD&lt;/P&gt;&lt;P&gt;Current Month: TOTALMTD&lt;/P&gt;&lt;P&gt;previous day: CALCULATE(&amp;nbsp; SUM(DATA)&amp;nbsp; ,&amp;nbsp; DATEADD( DATESTABLE&amp;nbsp; ,&amp;nbsp; -1&amp;nbsp; , DAY))&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 23:02:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3890197#M151720</guid>
      <dc:creator>TRIXTERBINOOB</dc:creator>
      <dc:date>2024-05-03T23:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: I want to write a Dax to get Current Year and Previous day Value of Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3893570#M151773</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; and &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736848" data-lia-user-login="TRIXTERBINOOB" class="lia-mention lia-mention-user"&gt;TRIXTERBINOOB&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="736663" data-lia-user-login="Ais12_" class="lia-mention lia-mention-user"&gt;Ais12_&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Year Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=YEAR(_today)),[Sales])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Current Month Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=YEAR(_today)&amp;amp;&amp;amp;MONTH('Table'[Date])=MONTH(_today)),[Sales])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Previous day Value Measure =
var _today=TODAY()
return
 SUMX(
    FILTER(ALL('Table'),
    'Table'[Date]=_today-1),[Sales])&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 03:44:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/I-want-to-write-a-Dax-to-get-Current-Year-and-Previous-day-Value/m-p/3893570#M151773</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-06T03:44:56Z</dc:date>
    </item>
  </channel>
</rss>

