Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a KPI which calculates the average of a database column for the current year. I also have a line graph that shows the average for this column for each year. The issue is that the KPI is returning 9.5 whilst the line graph is showing 6.5.
I have vCurrentYear as a variable equal to today's year - this is working and equates to 2021.
The KPI measure:
avg(if(year(created_at)=vCurrentYear, total_no_of_visits))
The chart dimension:
year(created_at)
The chart measure:
avg(total_no_of_visits)
can u try like if(year(created_at)=vCurrentYear, avg(total_no_of_visits))