<?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 find first non blank value in a calculated column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1787037#M37571</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try a couple of things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Change [Designation Measure] to return BLANK instead of 0 as the "else"&lt;/P&gt;
&lt;P&gt;2) See if this measure works in your complete data model (in this case we are using FIRSTNONBLANK not FNBVALUE because you want the value from the key column)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FNB =
MAXX (
    FIRSTNONBLANK ( FTBxs_Cumulative[Transit Time on Truck], [Designation Measure] ),
    FTBxs_Cumulative[Transit Time on Truck]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your full model may be more complex and need some additional coding, but hopefully this sends you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Thu, 15 Apr 2021 13:26:45 GMT</pubDate>
    <dc:creator>dedelman_clng</dc:creator>
    <dc:date>2021-04-15T13:26:45Z</dc:date>
    <item>
      <title>How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785365#M37500</link>
      <description>&lt;P&gt;I have tried everything and cannot figure out how to calculate firstnonblank value of a calculated column. I have read elsewhere that the FIRSTNONBLANK function only works on source columns. If this is true, then is there a workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought that I could use the FIRSTNONBLANK function on the &lt;EM&gt;Time of Transit&lt;/EM&gt; column (even though there are no blank values) but filter to get the first value of the &lt;EM&gt;Transit Day&amp;gt;=0.95&lt;/EM&gt;&amp;nbsp;column based on the FILTER function. Sample data set is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns not bolded are source columns.&amp;nbsp;&lt;STRONG&gt;Bolded columns are measure columns.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Time of Transit on Truck (in Days)&lt;/TD&gt;&lt;TD&gt;Quantity of Fruit Boxes&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Running Total&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;%Total of Boxes&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Transit Days &amp;gt;=0.95&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.04&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;0.35&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;18&lt;/TD&gt;&lt;TD&gt;0.69&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;0.77&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;0.85&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;23&lt;/TD&gt;&lt;TD&gt;0.88&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;0.96&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;26&lt;/TD&gt;&lt;TD&gt;1.00&lt;/TD&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 14 Apr 2021 19:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785365#M37500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-14T19:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785489#M37510</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First off there's really no such thing as a "measure column" - there are source columns and calculated columns, but those are only populated/updated when the data is refreshed.&amp;nbsp; A measure can be *used* as a column in table or matrix visual, but it acts very different than a calculated column, in that it recalculates any time the context changes.&amp;nbsp; Sounds like you're wanting to use a measure here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now,&amp;nbsp;LASTNONBLANK and FIRSTNONBLANK bring back a one row/one column table based on the source table/column you are using. These can't generally be used as a result or output (unless you're creating a calculated table) - they're generally used as modifiers inside code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, they have related functions LASTNONBLANKVALUE and FIRSTNONBLANKVALUE, which is what you want to get the actual value returned, not which date/order/etc has the last/first blank value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All that being said, can you share the code for the measures you currently have, and if possible what your data model looks like (if it's not a single table model like you indicate above)? Any information you can provide (a sample report file with sensitive data removed is always best, but any of the other things I mentioned would be a good start) would help point toward the solution you seek.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:05:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785489#M37510</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2021-04-14T21:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785490#M37511</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please be more clear on what it is you really want to calculcate? Do you want a measure? A column in a base table? And what's the precise definition of the quantity you want? Currently, I've only got a vague idea about your issue. For instance, if you look for the first Time Of Transit on Truck where Running Total % is &amp;gt;= 95%, then it's easy to find this value and make it into a measure or in the calculated column. But you've got 16 and 17 in the last column. Why?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 21:07:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785490#M37511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-14T21:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785653#M37524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes so basically what I want to do is, based on the transit time (4 days, 5 days, 8 days, etc.), I want to see how many days it would take to reach 95% of fruit boxes delivered. So I have the running total, and the last column populates the days that have reached that 95% delivery percentage (thus why there are only two values). However, I want to just retrieve the first value once the %total reaches 95% or above (in this instance, 16 days). In 16 days, the delivery percentage reached 96%, thus meeting the criteria. This is a continuation of an earlier question that I posted on here, but never got an answer. Does this make sense?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Apr 2021 23:25:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785653#M37524</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-14T23:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785659#M37525</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I should have just said measure. That's what it is. Thank you for clarifying! Okay so I should rephrase. The first two columns are calculated columns that I created when I transformed the data in PBI Desktop. The rest of the columns are measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Table]: FTBxs_Cumulative&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Running Total = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR RunningTotal= CALCULATE([Quantity of Fruit Boxes], FILTER(ALL(FTBxs_Cumulative([Transit Time on Truck]), FTBxs_Cumulative[Transit Time on Truck]&amp;lt;=MAX(FTBxs_Cumulative[Transit Time on Truck])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN IF(COUNTROWS(FTBxs_Cumulative), RunningTotal)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%Total of Boxes = DIVIDE([Running Total],[SumValuebyday])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Transit Days &amp;gt;=0.95 = IF([Designation Measure]=1, SELECTEDVALUE(FTBxs_Cumulative([Transit Time in Truck]), BLANK())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;I did not include these measures in the table, but it's used to calculate %Total of Boxes and Transit Days&amp;gt;=0.95:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SumValuebyday = CALCULATE(SUM([Quantity of Fruit Boxes]),ALLSELECTED(FTBxs_Cumulative[Transit TIme on Truck]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Designation Measure = IF([%Total of Boxes]&amp;gt;=0.95, 1, 0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Apr 2021 23:50:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785659#M37525</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-14T23:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785692#M37527</link>
      <description>&lt;P&gt;The Quantity of Boxes is a calculated column (again, done in PBI Desktop when transforming data), and it calculates the quantity by the , delimiter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oddly, I had to end up summing the Quantity of Boxes calculated column when brought into the visual rather than count because then it would still only count one value in the instances where there were more than one.&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 00:44:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1785692#M37527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-15T00:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1787037#M37571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try a couple of things:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Change [Designation Measure] to return BLANK instead of 0 as the "else"&lt;/P&gt;
&lt;P&gt;2) See if this measure works in your complete data model (in this case we are using FIRSTNONBLANK not FNBVALUE because you want the value from the key column)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FNB =
MAXX (
    FIRSTNONBLANK ( FTBxs_Cumulative[Transit Time on Truck], [Designation Measure] ),
    FTBxs_Cumulative[Transit Time on Truck]
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your full model may be more complex and need some additional coding, but hopefully this sends you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 13:26:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1787037#M37571</guid>
      <dc:creator>dedelman_clng</dc:creator>
      <dc:date>2021-04-15T13:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find first non blank value in a calculated column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1787338#M37581</link>
      <description>&lt;P&gt;OH MY GOODNESS!!! THANK YOU!!!! IT WORKED!!!! I am SO EXCITED!!!! Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13353" data-lia-user-login="dedelman_clng" class="lia-mention lia-mention-user"&gt;dedelman_clng&lt;/a&gt;!!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 15:45:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-find-first-non-blank-value-in-a-calculated-column/m-p/1787338#M37581</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-15T15:45:12Z</dc:date>
    </item>
  </channel>
</rss>

