Cumulative bar graph/nested IF

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
Hi, I'm tryign to produce a cumulative bar graph showing cumulative months along the X axis & value on the Y axis, i can create the below which provides total value by month:

If([Month]="01. Jan", [YTD Jan],
[Month]="02. Feb", [YTD Feb], 
[Month]="03. Mar", [YTD Mar],
[Month]="04. Apr", [YTD Apr],
[Month]="05. May", [YTD May],
[Month]="06. Jun", [YTD Jun],
[Month]="07. Jul", [YTD Jul],
[Month]="08. Aug", [YTD Aug],
[Month]="09. Sep", [YTD Sep],
[Month]="10. Oct", [YTD Oct],
[Month]="11. Nov", [YTD Nov],
[Month]="12. Dec", [YTD Dec],

And if i do only one i.e. (i just used Jan as an example):

If([Month]="01. Jan", [YTD Feb]+[YTD Jan], 

This adds up Jan & Feb

However if i start with Jan on it's own and then try Feb:

If([Month]="01. Jan", [YTD Jan], 
[Month]="02. Feb", [YTD Jan]+[YTD Feb], 

It displays Jan on it's own but nothing in the graph for Feb so 0.

Any assistance or guidance would be much appreciated?

Photo of Iain Stewart

Iain Stewart

  • 70 Points

Posted 2 years ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,698 Points 20k badge 2x thumb
So "IF" and "Case" statements only return one value.  The first true value in the sequence.

If you want a cumulative function like this. I'd recommend that you set up a 'parent summary' table to accomplish this.

If you set up a "Months" table, and "Years" table, you should be able to automatically roll up all the values for YTD and sequenced data.