I used timeShift function (${__timeShift(yyyy-MM-01'T'00:00:00.000'Z',,-P1M,,)}) to generate the previous month first date but the jmeter was still print the current month's first date.
I also tried ${__timeShift(yyyy-MM-01,,,-P1M)} and ${__timeShift(yyyy-MM-01,,P1M,-)} but with these functions as well jmeter was printing current month's date.
How can I generate previous month's first date in jmeter using timeShift function?
I don't think you will be able to use __timeShift() function for this. As per Duration.parse() javadoc
So you're subtracting 1 minute, not 1 month.
My expectation is that you should go for __groovy() function, something like:
should do the trick for you:
More information on Groovy scripting in JMeter: Apache Groovy: What Is Groovy Used For?