Measure to Calculate YTD does not work if when a new month is selected

Mavericks334

Active Member
Joined
Jan 26, 2011
Messages
280
Hi,

I have a measure that calculates the YTD values. I have a filter that allows a person to select the month. Based on the filter the YTD values get updated.

When my filter is on the 1st month. The Monthly and YTD Values are the same. When i select the second month instead of adding both the 1st and 2nd month together it is adding some other values and giving me an incorrect value.

Below is the measure that i have written.

Code:
YTD: Cascade_YTD_Tickets: =CALCULATE([Total_Ticket_Queued],DATESBETWEEN(Dates[Dates],DATEADD(LASTDATE(Year_Period[Next_Month_Start_Date]),MAX(Year_Period[Calendar_Period])*-1,MONTH),LASTDATE(Year_Period[Month_End_Date]))) /CODE].

Regards,
Ren.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
When i use this measure

=CALCULATE([Total_Ticket_Queued],DATESBETWEEN(Dates[Dates],DATEADD(LASTDATE(Year_Period[Month_Start_Date]),[Selected_Calendar_Period]*-1,MONTH),[Selected_Month_End_Date]))

It addes the previous two months. One which is of the previous year

It should add Jan and Feb. However it is adding Dec+Jan+Feb. Any Suggestions what needs to be changed.
 
Upvote 0

Forum statistics

Threads
1,223,986
Messages
6,175,788
Members
452,670
Latest member
nogarth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top