Add column with comparative percentage of years

  • 28 October 2022
  • 3 replies

Hi guys!I would like to know how I can add a column that presents the percentage calculation comparing the values ​​of a year with the previous year, as shown in the table below. I only need three columns... if possible to show in "green" the growth and in "red" the fall. Could you help me please?

Best answer by Moises Morales 29 October 2022, 01:01

View original

3 replies

Userlevel 3

Hi Douglas, you will need to create a separate metric for this and then you will need to apply formatting so the numbers show in red or green as needed:

I'm not able to bring the annual comparison with this metric… could you tell me what I'm doing wrong?The colors I managed to configure, thank you very much!
Userlevel 3

Hi Douglas, you need to specify a function for the first part of the metric. In this case, it should be something like: 


SELECT COUNT (Quantidade - Quantidade, Quantidade - Quantidade) for Previous (year(Datamovimento))


This of course is all dependant on your LDM and you may need to use a connection point of the data set to interact with other objects in the report. There is a great free course on our University page where you can learn more about MAQL functions: