8 Replies Latest reply on Oct 14, 2019 11:16 AM by Saikrishna Kommineni

# How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

Hi

I have a Received \$ measure it's already aggregated.  I would like to Display currency format 'B' , 'M' , 'K'  Dynamically based upon user selection with my Measure

Can you help me how can I do with calculated fields

Please find the attached workbook Tableau Version 10.5

Any help would be appreciated,

Thanks

• ###### 1. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

You can create a calculated field like this and display the value as shown below:

ELSE

END Hope this helps.

• ###### 2. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

I have another scenario How can we achieve using Dimensions

Dimensions: Dim 1

Measure: Entity

Measure Definition :  IF [Dim1] = 'GMC' and [Dim1] <> 'DL' Then [Entity] Else 0 END

Can we use the same syntax to replicate the same BM K Format here as well?

• ###### 3. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

Yes, you should be able to do it here too. Try it and let me know.

• ###### 4. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

Hi Hari,

Thanks for all your help I am using below syntax to display Dynamic Billion Million format, but I am getting an error Can you please help me

Error: Expected type string, Found integer results type from if expression must match

Dimensions: Data lake Count Type Name, Data Lake BU Full Name

Measures: Entity BMK

Syntax : IF [Data Lake Count Type Name] = 'Golden_Member_Count' and [Data Lake BU Full Name] <> 'Data Lake' Then [Entity Count BMK ] Else 0 END

Entity Count BMk :

IF SUM([Entity Count])>=1000000000 THEN

STR(ROUND(SUM([Entity Count])/1000000000,1))+"B"

ELSEIF SUM([Entity Count])>=1000000 THEN

STR(ROUND(SUM([Entity Count])/1000000,1))+"M"

ELSEIF SUM([Entity Count])>=1000 THEN

STR(ROUND(SUM([Entity Count])/1000,1))+"K"

ELSE

STR(ROUND(SUM([Entity Count]),1))

END

• ###### 5. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

Put the Zero in quotes in this as shown below:

Syntax : IF [Data Lake Count Type Name] = 'Golden_Member_Count' and [Data Lake BU Full Name] <> 'Data Lake' Then [Entity Count BMK ] Else "0" END

1 of 1 people found this helpful
• ###### 6. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

I tried that way it Doesn't work for me. Can you please check once

• ###### 7. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'
1 of 1 people found this helpful
• ###### 8. Re: How to Create Dynamic Calculated Field Measure to Display currency format 'B' , 'M' , 'K'

Thanks a lot Appreciate your help