<?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: How to repeat the latest measure result that doesn't show blank in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-repeat-the-latest-measure-result-that-doesn-t-show-blank/m-p/3264982#M120838</link>
    <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your datamodel.&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;LI-CODE lang="markup"&gt;Result measure: = 
VAR _currentrow =
    MAX ( 'Calendar'[Month Year sort] )
VAR _monthyeartable =
    ADDCOLUMNS (
        FILTER (
            ALLSELECTED ( 'Calendar'[Month Year], 'Calendar'[Month Year sort] ),
            'Calendar'[Month Year sort] &amp;lt;= _currentrow
        ),
        "@result", CALCULATE ( SUMX ( Data, Data[Price] * Data[Qty] ) )
    )
VAR _nonzeromaxmonthyear =
    MAXX ( FILTER ( _monthyeartable, [@result] &amp;lt;&amp;gt; 0 ), 'Calendar'[Month Year sort] )
RETURN
    IF (
        HASONEVALUE ( 'Calendar'[Month Year] ),
        CALCULATE (
            SUMX ( Data, Data[Price] * Data[Qty] ),
            FILTER (
                ALLSELECTED ( 'Calendar' ),
                'Calendar'[Month Year sort] = _nonzeromaxmonthyear
            )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 03:43:06 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-06-02T03:43:06Z</dc:date>
    <item>
      <title>How to repeat the latest measure result that doesn't show blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-repeat-the-latest-measure-result-that-doesn-t-show-blank/m-p/3264912#M120833</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a measure that returns a result that I want to show for each month. However, the data behind the measure is not available for all months and will therefore return a blank when no data is available in the underlying fact table.&lt;BR /&gt;&lt;BR /&gt;I have been asked to repeat the latest available result for each month until new data is available. I have pasted an example of what I'm trying to achieve below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current Result&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Desired Result&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Month Year&lt;/TD&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Nov-22&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec-22&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jan-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Feb-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mar-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apr-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;May-23&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Model Snapshot&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The measure calculates a result using a field in the &lt;STRONG&gt;All Metrics&lt;/STRONG&gt; table which is then aggregated up to a Control from the Controls table.&lt;BR /&gt;&lt;BR /&gt;The &lt;EM&gt;&lt;STRONG&gt;Month Year&lt;/STRONG&gt;&lt;/EM&gt; field is from the &lt;STRONG&gt;Date&lt;/STRONG&gt; table which is linked to&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;day_date&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;in the &lt;STRONG&gt;All Metrics&lt;/STRONG&gt; table via&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;fulldatealternatekey&lt;/STRONG&gt;.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;img /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measure Snapshot&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The current measure in use will return a 0 when there is no data available for a given month which is the correct behaviour in most contexts.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However, I need a separate measure to repeat the latest result by month year.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Current Measure&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Proposed Measure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I've been attempting a number of variants on the below measure:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The trouble is I can easily remove the filter context being applied to the&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;day_date&amp;nbsp;&lt;/EM&gt;&amp;nbsp;&lt;/STRONG&gt;in the visual and return a non blank result for all records in the&amp;nbsp;&lt;STRONG&gt;all_metrics&amp;nbsp;&lt;/STRONG&gt;table but I can't reapply the filter context to make sure only the latest result is returned.&lt;BR /&gt;&lt;BR /&gt;If someone could please help me work out to show only the latest non blank result that would be so helpful.&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 02:55:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-repeat-the-latest-measure-result-that-doesn-t-show-blank/m-p/3264912#M120833</guid>
      <dc:creator>Tings2</dc:creator>
      <dc:date>2023-06-02T02:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to repeat the latest measure result that doesn't show blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-repeat-the-latest-measure-result-that-doesn-t-show-blank/m-p/3264982#M120838</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your datamodel.&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;LI-CODE lang="markup"&gt;Result measure: = 
VAR _currentrow =
    MAX ( 'Calendar'[Month Year sort] )
VAR _monthyeartable =
    ADDCOLUMNS (
        FILTER (
            ALLSELECTED ( 'Calendar'[Month Year], 'Calendar'[Month Year sort] ),
            'Calendar'[Month Year sort] &amp;lt;= _currentrow
        ),
        "@result", CALCULATE ( SUMX ( Data, Data[Price] * Data[Qty] ) )
    )
VAR _nonzeromaxmonthyear =
    MAXX ( FILTER ( _monthyeartable, [@result] &amp;lt;&amp;gt; 0 ), 'Calendar'[Month Year sort] )
RETURN
    IF (
        HASONEVALUE ( 'Calendar'[Month Year] ),
        CALCULATE (
            SUMX ( Data, Data[Price] * Data[Qty] ),
            FILTER (
                ALLSELECTED ( 'Calendar' ),
                'Calendar'[Month Year sort] = _nonzeromaxmonthyear
            )
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 03:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-repeat-the-latest-measure-result-that-doesn-t-show-blank/m-p/3264982#M120838</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-06-02T03:43:06Z</dc:date>
    </item>
  </channel>
</rss>

