1

I have build a matrix in my report that brings data for every month. I need to check if the data for current month is greater or lesser than the previous month. If the data is greater than the previous month, then the foreground colour will be turned as "Green" else "Red"

To put things into perspective, example is attached herewith.

SSRS Report: enter image description here

Preview of the report:

enter image description here

As you can see the preview of the report,for first row, Sep 2019 revenue and Oct 2019 revenue are 574,100 and 217,900 respectively. Hence the october 2019 value will be in RED as revenue has fallen down as compare to Sep 2019. Similarly, the logic is same for "Gross Margin" column

How do I enter the color value for each month and subsequently for quarter values also (as quarter values will also be compared)?

Question EDIT enter image description here

xorpower
  • 17,975
  • 51
  • 129
  • 180
  • Something like this in the font colour expression for the textbox `=IIF(Sum(Fields! Amount.Value) < Previous(Sum(Fields!Amount.Value))), "Red", "Black")` – aduguid Nov 26 '19 at 14:27
  • Let me try that.. I think the Previous function doesn't work in Table or Matrix – xorpower Nov 26 '19 at 14:31
  • @aduguid: Yes it does work but I am not able to get the color in a proper manner.. I'll update my question to show the image – xorpower Nov 26 '19 at 14:41
  • @aduguid: If you see in the updated image, the first row is showing incorrect colors- the value of Oct 2019 should be red (as the value has decreased) from Sep 2019. Row 2 is fine. Row 3 is incorrect. Same goes for value 748,572.. It looks like some silly piece of code is missing – xorpower Nov 26 '19 at 14:45
  • You may need to reference the column group revenue – aduguid Nov 26 '19 at 14:49
  • `=IIF(Sum(Fields! Amount.Value, "Revenue") < Previous(Sum(Fields!Amount.Value, "Revenue"))), "Red", "Black")` – aduguid Nov 26 '19 at 14:51
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/203110/discussion-between-aduguid-and-xorpower). – aduguid Nov 26 '19 at 14:54
  • "Revenue" is just a header for better understanding. I am using Amount column in formulae @aduguid – xorpower Nov 26 '19 at 14:54
  • If you're only showing the Current and Previous quarters, it might be a LOT easier to NOT use a matrix and hard code the `Q` and `Q - 1` columns. – Hannover Fist Nov 26 '19 at 17:55
  • If you are using Column Groups then you need to include the Group Name to pull the previous value from. Previous(SUM(Fields!MyValue.Value),"grpColumnQuarters") – Ross Bush May 19 '21 at 15:57

0 Answers0