<?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: Comparing the same days of the current month year to year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3028245#M103353</link>
    <description>&lt;P&gt;Thank you for your answer&amp;nbsp;but that's not quite what I'm looking for.&amp;nbsp;I would like the chart to show full data for months other than the current one&amp;nbsp;and comparison to the current day only for the current month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On January 18 2023, the chart will show a comparison of January 1-17 for individual years - 2020, 2021, 2022, 2023.&amp;nbsp;The remaining months (February to December) for the years 2020-2022 will be presented normally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On March 7, 2023, the chart will show a comparison of March 1-6 for the years 2020-2023. Full January and February data for 2020-2023 and full April-December data for 2020-2022.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jan 2023 09:48:51 GMT</pubDate>
    <dc:creator>jkoclejda</dc:creator>
    <dc:date>2023-01-18T09:48:51Z</dc:date>
    <item>
      <title>Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026354#M103210</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple bar chart that shows monthly revenue broken down by years&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It's January now, and there's no point in comparing half a month to whole month in previous years.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am wondering how to write a calculation formula that would show the sum for the period of days that have passed in the current month and the total for the remaining months?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So today (January 17, 2023) , for past years, the chart will show a comparison only up to and including January 16.&amp;nbsp;If today was February 3rd, the chart will show full January (and the remaining months after February), but for February only up to the 3rd day.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:51:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026354#M103210</guid>
      <dc:creator>jkoclejda</dc:creator>
      <dc:date>2023-01-18T09:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026367#M103212</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="391826" data-lia-user-login="jkoclejda" class="lia-mention lia-mention-user"&gt;jkoclejda&lt;/a&gt;&amp;nbsp;You can use DAX's EDATE function for things like that.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 15:55:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026367#M103212</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-01-17T15:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026594#M103230</link>
      <description>&lt;P&gt;&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;Can you give me an example based on my case? Should I use it with IF to make it works only with current month&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 17:16:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3026594#M103230</guid>
      <dc:creator>jkoclejda</dc:creator>
      <dc:date>2023-01-17T17:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3027798#M103319</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="391826" data-lia-user-login="jkoclejda" class="lia-mention lia-mention-user"&gt;jkoclejda&lt;/a&gt;&amp;nbsp;,&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;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Flag =
var _todat=TODAY()
return
IF(
    MAX('Table'[Month]) = FORMAT(_todat,"mmm"),1,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure =
var _today=
TODAY()
return
SUMX(
    FILTER(ALLSELECTED('Table'),    'Table'[Year]=YEAR(MAX('Table'[Date]))&amp;amp;&amp;amp;MONTH('Table'[Date])=MONTH(_today)&amp;amp;&amp;amp;DAY('Table'[Date])&amp;lt;=DAY(_today)),[Value])&lt;/LI-CODE&gt;
&lt;P&gt;2. Place [Flag]in Filters, set is=1, apply filter.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. 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>Wed, 18 Jan 2023 07:00:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3027798#M103319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T07:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3028245#M103353</link>
      <description>&lt;P&gt;Thank you for your answer&amp;nbsp;but that's not quite what I'm looking for.&amp;nbsp;I would like the chart to show full data for months other than the current one&amp;nbsp;and comparison to the current day only for the current month.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;On January 18 2023, the chart will show a comparison of January 1-17 for individual years - 2020, 2021, 2022, 2023.&amp;nbsp;The remaining months (February to December) for the years 2020-2022 will be presented normally.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On March 7, 2023, the chart will show a comparison of March 1-6 for the years 2020-2023. Full January and February data for 2020-2023 and full April-December data for 2020-2022.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 09:48:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3028245#M103353</guid>
      <dc:creator>jkoclejda</dc:creator>
      <dc:date>2023-01-18T09:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing the same days of the current month year to year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3028835#M103415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="391826" data-lia-user-login="jkoclejda" class="lia-mention lia-mention-user"&gt;jkoclejda&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a measure that uses a separate date table (called Baseline Date in my model) that has a month number column.&amp;nbsp; You would replace the 'Baseline Activity Count' measure with your revenue (or whatever) measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Monthly Comparison = 
VAR _Today = TODAY()
VAR _Month = SELECTEDVALUE('Baseline Date'[Baseline Month Num])
VAR _CurrentMonth = MONTH(_Today)
VAR _Result = 
IF(_CurrentMonth = _Month,
    CALCULATE(
        [Baseline Activity Count],
        //get dates to today
        FILTER(VALUES('Baseline Date'[Baseline Date]), DAY('Baseline Date'[Baseline Date]) &amp;lt;= DAY(_Today))
    ),
    //use the measure as is, in effect getting all dates for the month
    [Baseline Activity Count]
)
RETURN
    _Result&lt;/LI-CODE&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;</description>
      <pubDate>Wed, 18 Jan 2023 13:55:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Comparing-the-same-days-of-the-current-month-year-to-year/m-p/3028835#M103415</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2023-01-18T13:55:32Z</dc:date>
    </item>
  </channel>
</rss>

