title: Power BI extract filename from path in table
body: <p>In Power BI does anyone have any idea how I can extract a filename from a path in a table column without using SQL?  DAX does not seem to have reverse searches. Also please note that some file names do not have paths.</p>
  
  <p>In SQL I could achieve this with the following:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CASE
          WHEN @FullPath = 'TRUE' OR CHARINDEX('\', dbo.Usage.App) = 0 THEN 
            UPPER(dbo.Usage.App)
          ELSE
            UPPER (RIGHT(dbo.Usage.App, CHARINDEX('\', REVERSE(dbo.Usage.App)) -1))
      END
      AS AppName
  </code></pre>