<?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: Get last non blank value in column to calculate missed production by date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757294#M146586</link>
    <description>&lt;P&gt;Hm... I really doubt it would work by just removing "=" from "&amp;lt;="; you can observe it on 2024/1/18 (or any Down in a row).&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 07:58:18 GMT</pubDate>
    <dc:creator>ThxAlot</dc:creator>
    <dc:date>2024-03-12T07:58:18Z</dc:date>
    <item>
      <title>Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3755846#M146525</link>
      <description>&lt;P&gt;This has me wanting to throw my laptop out the window and bang my head against a wall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See image for details, but I'm trying to return the last non blank "production" amount to calculate "missed production" for days where there were down hours.&amp;nbsp; (so first example is ends up being E4/24*D5 and E4/24*D6, and then E10/24*D11)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using Excel just for illustration purposes.&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;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 16:21:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3755846#M146525</guid>
      <dc:creator>mgcchkn</dc:creator>
      <dc:date>2024-03-11T16:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3756103#M146540</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 18:40:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3756103#M146540</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2024-03-11T18:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3756207#M146546</link>
      <description>&lt;P&gt;Your solution works as described.&amp;nbsp; I messed up my example dataset though.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My dataset does contain a number in the Production column (between 0-100) even when there is Down Hours.&amp;nbsp; So I'd need it to find the last day that didn't have Down Hours instead of the lastnonblank.&amp;nbsp; I thought I had it when I removed the &amp;lt;= and just made it a &amp;lt; but it got the previous number because it wasn't a blank.&amp;nbsp;&lt;BR /&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for messing that up.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 20:30:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3756207#M146546</guid>
      <dc:creator>mgcchkn</dc:creator>
      <dc:date>2024-03-11T20:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757029#M146571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434153" data-lia-user-login="mgcchkn" class="lia-mention lia-mention-user"&gt;mgcchkn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474658" data-lia-user-login="ThxAlot" class="lia-mention lia-mention-user"&gt;ThxAlot&lt;/a&gt;&amp;nbsp;for your contribution to the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you can try this:&lt;BR /&gt;Create a calculate column in the table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Missed production = 
VAR _previousDate =
    IF (
        'Table'[Down Date] &amp;lt;&amp;gt; BLANK (),
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Date] &amp;lt; EARLIER ( 'Table'[Date] )
                    &amp;amp;&amp;amp; 'Table'[Down Date] = BLANK ()
            )
        )
    )
VAR _previousProduction =
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Production] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Date] = _previousDate )
    )
RETURN
    ( _previousProduction / 24 ) * 'Table'[Down Hours]&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If the above one can't help you, could you please provide more&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&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;/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"&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"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;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"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 06:16:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757029#M146571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-12T06:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757294#M146586</link>
      <description>&lt;P&gt;Hm... I really doubt it would work by just removing "=" from "&amp;lt;="; you can observe it on 2024/1/18 (or any Down in a row).&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 07:58:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757294#M146586</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2024-03-12T07:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757304#M146589</link>
      <description>&lt;P&gt;Usually, TOPN() is more concise way to handle such scenarios.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 08:01:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3757304#M146589</guid>
      <dc:creator>ThxAlot</dc:creator>
      <dc:date>2024-03-12T08:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3758022#M146618</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474658" data-lia-user-login="ThxAlot" class="lia-mention lia-mention-user"&gt;ThxAlot&lt;/a&gt;&amp;nbsp;!&amp;nbsp; This worked perfectly!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:11:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3758022#M146618</guid>
      <dc:creator>mgcchkn</dc:creator>
      <dc:date>2024-03-12T13:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get last non blank value in column to calculate missed production by date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3758028#M146619</link>
      <description>&lt;P&gt;Thank you for the response!&amp;nbsp; For some reason when I do this, I don't get any results.&amp;nbsp; I'll have to play with it some more to see where I'm going wrong.&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="474658" data-lia-user-login="ThxAlot" class="lia-mention lia-mention-user"&gt;ThxAlot&lt;/a&gt;&amp;nbsp;'s 2nd solution did work however.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 13:13:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-last-non-blank-value-in-column-to-calculate-missed/m-p/3758028#M146619</guid>
      <dc:creator>mgcchkn</dc:creator>
      <dc:date>2024-03-12T13:13:08Z</dc:date>
    </item>
  </channel>
</rss>

