formatDate() doesn't work when a format is supplied

I’m running into an issue when using the formatDate() function in a calculated field. When I have it defined as formatDate(now()) then it works fine and outputs into a table visual.

However, when it’s defined as formatDate(now(), 'yyyy/dd/MM' ) then it shows an error:

Am I using this function incorrectly?

Hey @maat, what is the datasource you are using for your dataset? There are limitations to the format depending on the location of the source data.

Also, the formatDate value returns a string value. What if you tried changing the format in the field inside of the analysis. My response on this post provides an example of that: How do I change the date format displayed on a visual's axis in Amazon QuickSight? - #2 by DylanMorozowski

Last thing, if you look through the documentation for parseDate, you can see the date formats available depending on the datasource you are using.

Let me know if this helps!

Is my datasource relevant for this issue though? I’m using the function now() in the calculated field so I can’t imagine why the data source/set is relevant.

Hello @maat, I know you are using now(), but I am pretty sure the datasource is still relevant. The calculated field is on the dataset, so it will follow the same rules. Have you tried just changing the format from the field well instead of the calculated field?

Hi @maat ,

Just checking back in since we haven’t heard from you in a bit. I wanted to see if the guidance shared earlier helped resolve your question, or if you found a solution in the meantime.

If you still have any additional questions related to your initial post, feel free to share them. Otherwise, any update you’re able to provide within the next 3 business days would be helpful for the community.

Thank you

Hi @maat ,

Since I haven’t received any further updates from you, I’ll treat this inquiry as complete for now. If you have any additional questions, feel free to create a new post in the community and link this discussion for context.

Thank you