2 Replies Latest reply: Jan 25, 2016 6:19 PM by Sangram Reddy RSS

    Custom color measurements

    Betty Habtemariam

      Hello everybody,

       

      Here comes another color question. I have a chart that looks like this:

       

      Skärmklipp.PNG

       

      I have 1 dimension and 2 measures:

       

      Skärmklipp 01.PNG

      Gross margin is calculated like this:

      Skärmklipp 02.PNG (for those who want to know).

       

       

       

      I would like to be able to custom color my measure (Gross Margin). Can anyone tell  me how to do it?

       

      Sincerely,

      Betty Habtemariam

        • Re: Custom color measurements
          bruno bertels

          Hi Betty

           

          May be somethink like this :

           

          ColorMix1(

          ((Sum(Sales)-sum(COGS))/Sum(Sales)-$(=min(aggr( ((Sum(Sales)-sum(COGS))/Sum(Sales), [Month])))))

          /

          $(=(max(aggr(((Sum(Sales)-sum(COGS))/Sum(Sales),[Month]))-min(aggr(((Sum(Sales)-sum(COGS))/Sum(Sales), [Month])))))),white(),blue())

           

          Hope it helps

           

          Bruno

          • Re: Custom color measurements
            Sangram Reddy

            Hi Betty,

             

            As you have the gross margin as one of he measures , you will be able to colour code the chart with just an if statement like this:

             

            if( (sum(sales)-sum(cogs))/sum(sales) > 0.5,green(), // greater than 50% green

            if( (sum(sales)-sum(cogs))/sum(sales) < 0.2,red(), // less than 20% red

            blue())) // else blue

             

            Thanks,

            Sangram