Calc field not working as expected

I have data in gsheet/ tablular format which I am connecting to QuickSight. It has metric column with value corresponding with it.

I am trying to create a KPI visual where KPI title will be Account Creation and the value will be 523.

I created a calculated filed like but when I use it in a KPI, I don’t get the correct value 523. I get a count of the value 1.

Can you help how do I correct this?

ifelse({metric_name} = ‘Account Creation’, {Actuals}, 0)

For example,

metric_name Actuals
Account Creation 523
Logins 3124
Active Users 1987

Hi @chaitea,
I understand the idea behind creating an ifelse statement here but that function would normally be used in a different scenario.
You should not need to create a calculated field for this instance, instead I would suggest setting up your KPI, put your ‘Actuals’ field in the Value section and then add a filter to your visual for ‘metric_name’ that excludes the other options.

Let me know if this works for your case or if you have any additional questions

Hi @Brett it’s not working for my usecase. I am still seeing value for count when I added column/field actual to Value filed and in filter just kept ‘Account Creation’

Hi @chaitea,

Is your ‘Actuals’ a string field or number field?
Could you provide a screenshot of your current setup, preferably including the field well for the visual like below:

Hi Bret, thank you for sharing this screenshot. I realized the field was non-numeric and that needed to be converted into numeric - decimal.

It worked :slight_smile: thanks for your help!

1 Like