# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor

## How to use a formula as the dynamic limit for conditional color in KPI

Hello to all!

I am a new user of Qlik Sense.

I have created a KPI for current month compared to last month and now I want to use as the dynamic limit for conditional color the value of last month (using the last month formula), but the value is the sum of all value.

what am I doing wrong?

These are the formulas:

current month: Sum( { \$< [Date / EndTest.autoCalendar.InMTD]={1}, [Date / EndTest.autoCalendar.MonthsAgo]={0} > } [Number of Tests] )

last month: Sum( { \$< [Date / EndTest.autoCalendar.InMTD]={1}, [Date / EndTest.autoCalendar.MonthsAgo]={1} > } [Number of Tests] )

2 Replies
Honored Contributor III

## Re: How to use a formula as the dynamic limit for conditional color in KPI

If possible share sample app

Honored Contributor III

## Re: How to use a formula as the dynamic limit for conditional color in KPI

I guess for Last Month it should be

Sum( { \$< [Date / EndTest.autoCalendar.InMTD]={0}, [Date / EndTest.autoCalendar.MonthsAgo]={1} > } [Number of Tests] )