{% macro metrics(title, value, data, type = "bar", hide_chart = False, col_size=3) %} {% set month_values = data.keys()|list %} {% set metric_values = data.values()|list %} {% set previous_month = metric_values[-3] %} {% set current_month = metric_values[-1] %} {% set current_month_date = month_values[-1] %} {% set changes_this_year = metric_values|max is greaterthan 0 %}

{{title}}

{{value | summarize}}

{% if changes_this_year and not hide_chart %}
{% endif %}
{% if current_month > 0 %}

{{current_month | summarize}} {{_(" in ")}} {{isodate(current_month_date + "-01", format="MMM yyyy")}}

{% endif %}
{% endmacro %}