Format date function not behaving as usual

Hey all,

I am creating a calculated field using formatDate function at dataset level : formatDate({Date},‘MMM-YYYY’)

This is what’s happening. :point_down:

Note : I have used the same function some time back in another data set and there its still working absolutely fine.

@emilyzhu Why would this happen ? Please help!

I think “YYYY” needs to be “yyyy” - I know “M” is different from “m”

Referencing: Supported date formats - Amazon QuickSight

Hey @Jesse
Could you please help with, why the format date function used in order to get the date in the format ‘Jan-22’ not working fine in one dataset but fine in the other.

I need to complete a dashboard and I am stuck at this.
Please help?

Hi @Ummehaani -

The supported date formats vary by date source.

  • What is your data source?
  • Are you using SPICE or Direct Query?

If you are wanting to format the date for your visual, the easiest approach is to format it in the UI.

If you need to truncate to month/year for calculations you can use.

truncDate('MM',dt)

Example: