Distinct count Measure (This Year vs Last Year - incomplete year)

jeancake

Board Regular
Joined
Nov 3, 2008
Messages
57
I'm trying to compute a distinct count of accounts this year vs last year. My transaction data is from 1/1/2019 through 9/30/2020. The distinct count is easy for 2020, but when I try to create a measure using SamePeriodLastYear I'm getting the full year distinct count for 2019, but I need it through 9/30/2019. Can someone help with the proper syntax for this measure?

Thanks in advance.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
jeancake

I don't know if you're using vba or cell functions, but if you were using cell functions it would go something like this:

If the last date for 2020 was in say cell E100 and the dates for 2019 were in say column H, then if you used COUNTIF(H:H,"<="&DATE(YEAR(E100)-1,MONTH(E100),DAY(E100))) then that would count the number of rows in column H that had dates that were less than or equal to today's date a year ago.
 
Upvote 0

Forum statistics

Threads
1,223,753
Messages
6,174,307
Members
452,554
Latest member
Louis1225

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