<?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: Measure that returns an yearly value for each month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1402022#M25822</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178063" data-lia-user-login="fpennisi17" class="lia-mention lia-mention-user"&gt;fpennisi17&lt;/a&gt;&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;/P&gt;
&lt;P&gt;&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>Tue, 29 Sep 2020 13:50:52 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-09-29T13:50:52Z</dc:date>
    <item>
      <title>Measure that returns an yearly value for each month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1401910#M25810</link>
      <description>&lt;P&gt;In my model, I have a table with Year and Year&amp;amp;Month columns.&lt;/P&gt;&lt;P&gt;For some measures in my dataset, I have a DAX measure that tells me im which Year&amp;amp;Month the measure itself has the last valid value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a report page in which the user selects a single year and a table with all the months in that year is shown.&lt;/P&gt;&lt;P&gt;For each month, the other column in the table should report the year &amp;amp; month for which a measure has last value, if the year is the same, otherwise the last month of the year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try to clarify with an example:&lt;/P&gt;&lt;P&gt;- I have data from 2018 to 2020&lt;/P&gt;&lt;P&gt;- One measure (Production) has its last value on August 2020 (this value is provided with the measure called "Last production Month"&lt;/P&gt;&lt;P&gt;- The user, in the report page, will select a year:&lt;/P&gt;&lt;P&gt;* if the year is 2020, the table should shown all 2020 months (Jan to Dec) in the first column and the month provided by the "Last Production Month" in the second column (in this case, August 2020)&lt;/P&gt;&lt;P&gt;* if the year is 2018 or 2019, the second column should show, instead, "December 2018" or "December 2019" respectively&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to achieve this with a DAX measure?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:41:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1401910#M25810</guid>
      <dc:creator>fpennisi17</dc:creator>
      <dc:date>2020-09-29T12:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure that returns an yearly value for each month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1402022#M25822</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="178063" data-lia-user-login="fpennisi17" class="lia-mention lia-mention-user"&gt;fpennisi17&lt;/a&gt;&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;/P&gt;
&lt;P&gt;&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>Tue, 29 Sep 2020 13:50:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1402022#M25822</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-29T13:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Measure that returns an yearly value for each month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1404430#M25891</link>
      <description>&lt;P&gt;You are right, I wrote a mess. I will try with an example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my "Year &amp;amp; Month"&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month ID&lt;/TD&gt;&lt;TD&g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gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-04&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-05&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-06&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-07&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-10&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-11&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-12&lt;/TD&gt;&lt;TD&gt;2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have several timeseries in the model (with 15 minute or daily granularity).&lt;/P&gt;&lt;P&gt;For each timeseries I created a DAX measure that returns the last Year&amp;amp;Month in which that timeseries registered data (e.g.: for the Production of a site, the last data was registered in September 2020, so the measure returns &lt;STRONG&gt;2020-09&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is the case, it means that I have data in the whole 2019 and in 2020 until september.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would like to create a DAX measure (let's call it "Last data"), for the previous timeseries, that returns the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the selected year is 2019, the last data for the timeseries in that year is on December, so:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month ID&lt;/TD&gt;&lt;TD&gt;Last data&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-01&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-02&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-03&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-04&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-05&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-06&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-07&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-08&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-09&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-10&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-11&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;TD&gt;2019-12&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the selected year is 2020, the last data for the timeseries in that year is on September, so:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month ID&lt;/TD&gt;&lt;TD&gt;Last data&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-01&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-02&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-03&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-04&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-05&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-06&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-07&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-08&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-10&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-11&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020-12&lt;/TD&gt;&lt;TD&gt;2020-09&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it is clear now.&lt;/P&gt;&lt;P&gt;Is that possible?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 10:32:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-that-returns-an-yearly-value-for-each-month/m-p/1404430#M25891</guid>
      <dc:creator>fpennisi17</dc:creator>
      <dc:date>2020-09-30T10:32:11Z</dc:date>
    </item>
  </channel>
</rss>

