5 Replies Latest reply on Jun 6, 2018 11:25 AM by Okechukwu Ossai

    Max of a metric that is already an aggregation

    Amir Sadighian

      Hello,

       

      I have looked at similar posts but did not find my answer.

       

      Lets say I have a metric "profit margin" that is calculated as SUM(profit)/SUM(Sales) and lets say I have various dimensions: Region, Category, Department, etc.

       

      Question: How can I get the Max of my profit margin as a metric that I can use in different views with different combination of dimensions used.

       

      1. MAX(profit margin) does not work because profit margin is already aggregate

      2. I cannot define profit margin at the level of data (at each row) because I want it to be aggregate at different combination of Region/Category/Department at the level of detail of view

      3. Max({profit margin}) also doesn't work; {profit margin} proves to be total profit divided by total sales irrespective of the level of detail of the view

       

      Would appreciate it if you can let me know if there is a way that I am missing or if there is already a conversation that I can refer to.

       

      Thanks,

       

      Amir