I'd recommend creating a couple of calculated fields as follows:
YA % Value
IF MIN(TRIM([Type]))="vs YA %" THEN
[YA % calc]
IF TRIM([Type])<>"vs YA %" THEN
Strictly speaking the ELSE NULL part isn't necessary, but I wanted to explicitly state it. So, YA % Value will be NULL unless the type is "vs YA %" and Other Value will be the opposite. It will always be Amount unless the type is "vs YA %". When one is NULL the other will have a value and vice versa.
Then you can place both of them on the text card.
Then click on the Text card and change it so the fields are side by side:
Because one will always be NULL, it will only show the one we want.
Finally, you can format the YA % Value field to show in percentage format. The result will look like this:
See the attached workbook.
Note: Your calculation for YA % Value always seems to result in NULL, so I think the calc or your data has some issues. To show how to make this work, I commented your code and simply set it to always be 0.5.
If this meets your needs, please be sure to mark my answer as correct.
MFT.twbx 53.0 KB
Thank you so much for the detailed explanation. Unfortunately I can't open your workbook which indicates a more newer version than mine. My version is 10.5 already. I wonder if Tableau already release another newer version than 10.5? I'll study and try your calculated field in my workbook, will get back to you soon. Thank you.
Fantastic. Would you please mark my answer as correct so others can see it if they visit this discussion? Thanks.