1 Reply Latest reply on Jun 24, 2018 10:37 AM by Deepak Rai

# Calculated fields for sum of measure for each quarter (for reference lines)

*I unable to post my workbook due to sensitive material*

Hello,

I am trying to make quarterly goal reference lines for a bar chart. The bar chart shows sales for different projects.

To do so, I am trying to make a calculated field for each quarter that sums a measure called "Planned Sales" based off of the date for the "Planned Sales''.

For a calculated field called "Q4 Goal" I have tried the following, but have gotten null values when I put "Q2 Goal" in a table as text and the filtered project name in the Rows:

IF YEAR([Date (copy)]) = YEAR(TODAY()) AND DATEPART('quarter', [Date (copy)]) = 4

THEN {FIXED [Date (copy)]: SUM([Planned Sales])}

END

Any ideas about how to get this calculation to work? Should I be doing this a different way?

Thanks!

• ###### 1. Re: Calculated fields for sum of measure for each quarter (for reference lines)

{FIXED [Date (copy)]: SUM(IF YEAR([Date (copy)]) = YEAR(TODAY()) AND DATEPART('quarter', [Date (copy)]) = 4 THEN [Planned Sales] END)}

Remember you are in Q2 of This year but your formula is for Q4