1 Reply Latest reply on Jun 6, 2016 6:58 PM by Ivan Young

    Average Gross Margin (calculated field) as a reference line

    Travis Hauck

      I am trying to show the average gross margin over a period of time displayed in years.

      I am calculating gross margin as a percentage via the calculation

       

       

      When I add a reference line in the traditional manner, it calculates the average of the individual points being displayed, which is not what I need.

       

       

      What I need is for the reference line to calculate the GM within each pane, without regard for the time period.  I suspect this might be done by an LOD calculation, but I don't have much experience there.  Can anyone help?  Thank you!

        • 1. Re: Average Gross Margin (calculated field) as a reference line
          Ivan Young

          Hi Travis,

          It's always a little easier to answer these types of questions when you post a twbx or some data.  Your intuition about using an LOD is spot on.  There's a couple ways you could write one for this view but I think {FIXED [Market Type],[Market Segment] : SUM([Gross Margin USD])/SUM([Order Value USD]) } should work.

           

          Try {FIXED [Market Type],[Market Segment] : SUM([Gross Margin USD])}/{FIXED [Market Type],[Market Segment] : SUM([Order Value USD])} if the previous one doesn't work.  Let me know if you have any questions.


          Good luck,

           

           

           

          Ivan