3 Replies Latest reply on Sep 25, 2018 12:43 AM by Andreas Kampianakis

    Discrete LOD on Hierarchy

    Andreas Kampianakis

      Hello world,
      I would like to create a sheet that gives me the the difference between the sales of the first time and the sales of the last time. In order to do that I did a calculation like this.


      {fixed [Category],[Sub-Category],[Product Name]: sum(IF [Order Date] = {fixed [Category],[Sub-Category],[Product Name]: max([Order Date]) } then [Sales] end) }-{fixed [Category],[Sub-Category],[Product Name]:

      sum(IF [Order Date] = {fixed [Category],[Sub-Category],[Product Name]: min([Order Date]) } then [Sales] end) }


      But when I put it in a hierarchy the whole thing is getting blown up.!
      So please, could someone help over this issue?
      I'd like this sales difference to be shown correctly no matter if I see in the hierarchy the category or I have expanded it til the product name.
      I also include a .twbx.
      Thanks everyone.!