title: Return the last non empty member of date dimension, based on other dimension
body: <p>New to MDX and a bit bewildered...</p>
  
  <p>We have a cube with an excel pivot table over the top for reporting. What I need to provide is  an easy means for people to see the max (last) member of the relevant date dimension when also sliced against another dimension, and the row count on that day. </p>
  
  <p>I have a "booking count" measure and I want to see the number of bookings on the last date I had any bookings for any other dimensions children. If that makes sense.</p>
  
  <p>The closest i've got so far is this:</p>
  
  <pre><code>select [Measures].[Booking Count] on 0, filter(([Sub Channel].[Channels].[Channel].members, [Booking Date].[Date].children), not isempty([Measures].[Booking Count])) on 1 from myCube
  </code></pre>
  
  <p>But I can't then use LastChild or similar to get the last member of each channel.</p>
  
  <p>Hope that makes sense! Huge thanks in advance for any help.</p>