<?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: Show sales until last available date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3188520#M115548</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solves the problem.&amp;nbsp;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2023 12:16:40 GMT</pubDate>
    <dc:creator>RoshanK</dc:creator>
    <dc:date>2023-04-14T12:16:40Z</dc:date>
    <item>
      <title>Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167021#M113934</link>
      <description>&lt;P&gt;I have simple calendar and sales table.My sales table has data until December 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I am looking for&lt;/STRONG&gt; is a measure that when user selects January/ Feb/March 2023, it shows the data until latest available time which is Dec 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Criteria: User can select multiple years but only single month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example; In this picture Jan 2023 is selected, since the Jan 2023 data is not available, I want all my Year-Month to change to Dec, so 2022-01 becomes 2022-12 and the rest follows. Any idea how this could be accomplished?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 09:53:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167021#M113934</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-04-01T09:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167029#M113936</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Not Clear completely.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So in your image, next to 2018-01 you need to show the value for which date? Should be cumulative? what interval?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please share your desired result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 10:22:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167029#M113936</guid>
      <dc:creator>MohammadLoran25</dc:creator>
      <dc:date>2023-04-01T10:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167033#M113937</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It sounds a bit weird but I want to show 2018-12 value in 2018-01.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 10:29:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167033#M113937</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-04-01T10:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167036#M113938</link>
      <description>&lt;P&gt;So you need to show the value of last month per year?&lt;/P&gt;&lt;P&gt;What is the role of your date slicer then?&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 10:33:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167036#M113938</guid>
      <dc:creator>MohammadLoran25</dc:creator>
      <dc:date>2023-04-01T10:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167039#M113940</link>
      <description>&lt;P&gt;Yes !&lt;BR /&gt;&lt;BR /&gt;When the data is updated on time, the slicer is used.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 10:47:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167039#M113940</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-04-01T10:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167040#M113941</link>
      <description>&lt;P&gt;Follow these steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1-In your Date Table, Create a calculated column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Month = Month(DateTable[Date])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2-Then Create the measure below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE (
    SUM ( SalesTable[Value] ),
    FILTER (
        ALL ( DateTable ),
        DateTable[Year] = MAX ( DateTable[Year] )
            &amp;amp;&amp;amp; DateTable[Month] = 12
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this answer solves your problem, give it a thumbs up and accept it as a solution so the others would find what they need easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Loran&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 10:56:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167040#M113941</guid>
      <dc:creator>MohammadLoran25</dc:creator>
      <dc:date>2023-04-01T10:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167614#M114034</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;It was what you needed?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 07:27:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167614#M114034</guid>
      <dc:creator>MohammadLoran25</dc:creator>
      <dc:date>2023-04-02T07:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167646#M114042</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="527398" data-lia-user-login="MohammadLoran25" class="lia-mention lia-mention-user"&gt;MohammadLoran25&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I appreciate it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this was not exactly how I wanted.&amp;nbsp;&lt;BR /&gt;For example,&amp;nbsp;&lt;/P&gt;&lt;P&gt;If user selects Feb 2023 &amp;amp; if the data is available until Jan 2023, your measure will return Dec 2022 value instead of jan 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a bit confusing because the data are not updated timely. Hence, brings complexity!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 10:09:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3167646#M114042</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-04-02T10:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3187927#M115501</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="495773" data-lia-user-login="RoshanK" class="lia-mention lia-mention-user"&gt;RoshanK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;If I understand correctly, you want to get the data in selected date period. And if there is no data in the selected year and month, it need to display the data which is the last available date before the selected date period. For example, if you select the year 2023 and the month Feb, but there is no data for 2023-02 in the fact table. And the last available date is on 2023-01, so the expected data should be the value on 2023-01. Am I right? If yes, you need to follow the steps below to get it:&lt;/P&gt;
&lt;P&gt;1. Make sure the field [Year-Month] and slicer field [Year]&amp;amp;[Month] are not from the same table, and &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;NOT&lt;/FONT&gt;&lt;/STRONG&gt; create relationship between the tables. If no, please create a new Year-Month dimension table first just as below screenshot&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below to &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;replace&lt;/STRONG&gt; &lt;/FONT&gt;the original one&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measurea =
VAR _selyears =
    ALLSELECTED ( 'Date'[Year] )
VAR _selmonth =
    SELECTEDVALUE ( 'Date'[MonthNum] )
VAR _selym =
    SELECTEDVALUE ( 'YM'[Year-Month] )
VAR _ymyear =
    VALUE ( LEFT ( _selym, 4 ) )
VAR _ymmonth =
    VALUE ( RIGHT ( _selym, 2 ) )
VAR _sales =
    SUMX (
        FILTER (
            'sales',
            YEAR ( 'sales'[xxdate] ) = _ymyear
                &amp;amp;&amp;amp; MONTH ( 'sales'[xxdate] ) = _selmonth
        ),
        [Total Sales]
    )
VAR _maxdate =
    CALCULATE (
        MAX ( 'sales'[xxdate] ),
        FILTER (
            'sales',
            'sales'[xxdate] &amp;lt; EOMONTH ( DATE ( _ymyear, _selmonth, 1 ), 0 )
                &amp;amp;&amp;amp; NOT ( ISBLANK ( [Total Sales] ) )
        )
    )
VAR _pymsales =
    SUMX (
        FILTER (
            'sales',
            YEAR ( 'sales'[xxdate] ) = YEAR ( _maxdate )
                &amp;amp;&amp;amp; MONTH ( 'sales'[xxdate] ) = MONTH ( _maxdate )
        ),
        [Total Sales]
    )
RETURN
    IF (
        (
            _ymyear
                IN _selyears
                    &amp;amp;&amp;amp; _ymmonth = _selmonth
                    &amp;amp;&amp;amp; NOT ( ISBLANK ( _sales ) )
        ),
        _sales,
        IF (
            _ymyear = YEAR ( _maxdate )
                &amp;amp;&amp;amp; _ymmonth = MONTH ( _maxdate ),
            _pymsales,
            BLANK ()
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the expected result,&amp;nbsp;could you&amp;nbsp;&lt;SPAN&gt;please provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your tables&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and your&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;with backend logic and special examples?&amp;nbsp;It would be helpful to find out the solution. You can refer the following links to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 07:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3187927#M115501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-14T07:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Show sales until last available date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3188520#M115548</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solves the problem.&amp;nbsp;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 12:16:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-sales-until-last-available-date/m-p/3188520#M115548</guid>
      <dc:creator>RoshanK</dc:creator>
      <dc:date>2023-04-14T12:16:40Z</dc:date>
    </item>
  </channel>
</rss>

