Hi Prashant, could attach a packaged workbook with some sample data to work with?
I'd like to know if fields Month Start Date and Month End Date are user selected? If so, you'd need parameters in combination with calc field.
Without knowing exactly what you're trying to do, I would suggest something like the following:
IF DATEPART('day', [date variable]) >= 15 THEN
DATEPART('month', [date variable]) - DATEPART('month', [contract start date]) + 1
DATEPART('month', [date variable]) - DATEPART('month', [contract start date])
Another function to consider is DATEDIFF.
If these don't help, it would be helpful to consider posting a workbook with your data.
You mean to say is, Start of the month is 15, say for e.g. 15/4/2018 to 14/5/2018 is considering as April month, 15/5/2018 to 14/5/2018 is May and so on.
And you need to show data for a specific month, as per above understanding, am I correct?
I hope this solves your query, attached is screenshot below:
1. Date is your original date.
2. The new month is the calculated field which will calculate the start of the month from 15 to 14 .
Formula: IF DAY([Date])<15 then DATEADD('day',-15,[Date])ELSE [Date] END
As per above formula 15 Jan to 14 Feb, it's giving me January and so on.
3. I have used month just to check if an above formula works or not.