title: DAX—LASTNONBLANK returns blank for string
body: <p>fairly new to DAX and Power BI. I am having trouble making the LASTNONBLANK function consistent when applied to strings. I have two tables that look like the following:</p>
  <p><a href="https://i.stack.imgur.com/5gmOr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5gmOr.png" alt="enter image description here" /></a></p>
  <p>I am trying to calculate the 'Category' column in Table 2 with the LASTNONBLANK function so that it returns the correct Category from Table 1. Since there are multiple entries for the same SKU, I am trying to use this function to select a single string. And yes, there are situations where the Category may be different for the same SKU, in which case the LASTNONBLANK function selects what I want correctly (i.e. reverse alphabetical).</p>
  <p>I am currently using the following function:</p>
  <pre><code>Category = CALCULATE(LASTNONBLANK(Table1[Category],0))
  </code></pre>
  <p>This function works, but not for all entries in Table 2. I apply it to the entire column, and about a third of the entries populate correctly. The rest all appear to be blank. I've checked the successful vs unsuccessful entries by SKU in Table 1, and I cannot see a difference.</p>
  <p>Any thoughts on the issue?</p>