3 Replies Latest reply: Jan 16, 2014 3:44 PM by whiteline _ RSS

    Change color of bar chart based on current selection(YTD Problem)

      Hello,

       

      I am changing the color of the bars in a Bar Chart based on a selection in 'Period Number'. This code below is working fine when selecting one or multiple 'Period Number(s)'.

       

      =IF(GETPOSSIBLECOUNT([Period Number])<>COUNT({1}DISTINCT TOTAL [Period Number]),
      IF(MATCH([Period Number],CONCAT(DISTINCT [Period Number],',')),
      RGB(252,100,98), ARGB(85,252,100,98)))
      

       

      Now i am trying to expand this code with my YearToDate function. So If variable vYTD = 1 he should change all colors of the bars witch are even or previous to the selection in 'Period Number'.

       

      Example:

      YTD is active and the Selected Period Number = 3

      Period 1: Green

      Period 2: Green

      Period 3: Green

      Period 4: Grey

      Period 5: Grey

      etc.

       

      I've tried different options but got none of the working.. Options like: IF(vYTD = 1 AND vMaxPeriod <= GetFieldSelections([Period Number]), GREEN(), RED()))

       

      Can someone please help me out? Thanks!

       

      Marco