<?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 Create a measure as last value of another measure for the year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1124071#M16597</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help. I have "Measure A", then I created "Measure B" and finally "Measure C". The problem is Measure B. I need that this measure takes the value of the last month available for Measure A, then divide this value by 12 and then asign the result to the whole year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the following image I show you how I would like to see it:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The dax is like this:&lt;/P&gt;&lt;P&gt;- Measure A is ok&lt;/P&gt;&lt;P&gt;- Measure B =&amp;nbsp;&lt;SPAN&gt;CALCULATE(DIVIDE([Measure A];12);&lt;/SPAN&gt;&lt;SPAN&gt;ALL('Date'[Fiscal Month]);'Date'[Fiscal Month Nr]=7)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Measure C = CALCULATE([Measure B]*[Month Nr])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last month available is Fiscal Month Nr = 7. I am filtering manually this data in Measure B by adding the last filter (&lt;SPAN&gt;'Date'[Fiscal Month Nr]=7&lt;/SPAN&gt;), but I need this to be dinamic and change to the following month (number &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; every time I load new data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can´t find a way to solve this. I have tried by adding a new column in my Date table to identify the last month with data but it doesn´t work in a calculate function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what can I do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 17:56:28 GMT</pubDate>
    <dc:creator>JOKA</dc:creator>
    <dc:date>2020-05-27T17:56:28Z</dc:date>
    <item>
      <title>Create a measure as last value of another measure for the year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1124071#M16597</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help. I have "Measure A", then I created "Measure B" and finally "Measure C". The problem is Measure B. I need that this measure takes the value of the last month available for Measure A, then divide this value by 12 and then asign the result to the whole year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the following image I show you how I would like to see it:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The dax is like this:&lt;/P&gt;&lt;P&gt;- Measure A is ok&lt;/P&gt;&lt;P&gt;- Measure B =&amp;nbsp;&lt;SPAN&gt;CALCULATE(DIVIDE([Measure A];12);&lt;/SPAN&gt;&lt;SPAN&gt;ALL('Date'[Fiscal Month]);'Date'[Fiscal Month Nr]=7)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Measure C = CALCULATE([Measure B]*[Month Nr])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The last month available is Fiscal Month Nr = 7. I am filtering manually this data in Measure B by adding the last filter (&lt;SPAN&gt;'Date'[Fiscal Month Nr]=7&lt;/SPAN&gt;), but I need this to be dinamic and change to the following month (number &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; every time I load new data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can´t find a way to solve this. I have tried by adding a new column in my Date table to identify the last month with data but it doesn´t work in a calculate function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what can I do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 17:56:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1124071#M16597</guid>
      <dc:creator>JOKA</dc:creator>
      <dc:date>2020-05-27T17:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure as last value of another measure for the year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1124792#M16607</link>
      <description>&lt;P&gt;Please try this expression for your measure.&amp;nbsp; This assumes your Fiscal Month Number column is numeric (you could convert that in the formula if text), and you've made a table visual with Fiscal Month Number, Month, and this measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure C =&lt;BR /&gt;VAR maxfiscalmonth =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;MAX ( Fiscal[FiscalMonthNumber] ),&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( Fiscal[FiscalMonthNumber] ),&lt;BR /&gt;NOT ( ISBLANK ( CALCULATE ( [Measure_A] ) ) )&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;VAR maxmonthvalue =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;SUM ( Fiscal[Measure A] ),&lt;BR /&gt;ALL ( Fiscal[FiscalMonthNumber] ),&lt;BR /&gt;Fiscal[FiscalMonthNumber] = maxfiscalmonth&lt;BR /&gt;)&lt;BR /&gt;VAR result =&lt;BR /&gt;SELECTEDVALUE ( Fiscal[FiscalMonthNumber] ) * maxmonthvalue / 12&lt;BR /&gt;RETURN&lt;BR /&gt;result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 02:29:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1124792#M16607</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-05-28T02:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure as last value of another measure for the year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1126800#M16641</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response! I tried this but didn´t work. Here is what I see now ("Measure D" is the one with the new expression):&lt;/P&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;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure D = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR maxfiscalmonth =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MAX ('Date'[Fiscal Month Nr]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL ('Date'[Fiscal Month Nr]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;NOT ( ISBLANK ( CALCULATE ('Measures 1'[Measure A]) ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR maxmonthvalue =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Measures 1'[Measure A];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL ('Date'[Fiscal Month Nr]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'Date'[Fiscal Month Nr] = maxfiscalmonth&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR result =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE ('Date'[Fiscal Month Nr]) * maxmonthvalue / 12&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 May 2020 14:13:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1126800#M16641</guid>
      <dc:creator>JOKA</dc:creator>
      <dc:date>2020-05-28T14:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure as last value of another measure for the year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1127915#M16670</link>
      <description>&lt;P&gt;I didn't have the Month name in my visual, so I didn't add that column to the All() parts.&amp;nbsp; If you replace the two All( ) with this, it should work&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ALL ('Date'[Fiscal Month Nr], 'Date'[Month])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 00:03:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1127915#M16670</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-05-29T00:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a measure as last value of another measure for the year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1139649#M17049</link>
      <description>&lt;P&gt;Now it works! Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 17:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-measure-as-last-value-of-another-measure-for-the-year/m-p/1139649#M17049</guid>
      <dc:creator>JOKA</dc:creator>
      <dc:date>2020-06-03T17:43:08Z</dc:date>
    </item>
  </channel>
</rss>

