Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Count values of the same month last year

I read through other suggestions and used SAMEPERIODLASTYEAR, and managed to make it work, except that when I filter the data, the fields all stop working. Doing more research on it, I found that for the SAMEPERIODLASTYEAR to work, it has to have all consective dates, so I created a CALENDAR Table, but now the previous measure isn't working. 

 

What am I missing?

 

CASES LAST YEAR =
CALCULATE(
DISTINCTCOUNT('Division CAS Report'[CAS Case ID]),
DATESMTD(SAMEPERIODLASTYEAR('Calendar'[DATES])
) )

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

From the Calendar Table, drag Year and Month to the slicer/filter section.  Select any year and month.  Write this measure

 

CASES LAST YEAR=CALCULATE(DISTINCTCOUNT('Division CAS Report'[CAS Case ID]),SAMEPERIODLASTYEAR('Calendar'[DATES]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

 

From the Calendar Table, drag Year and Month to the slicer/filter section.  Select any year and month.  Write this measure

 

CASES LAST YEAR=CALCULATE(DISTINCTCOUNT('Division CAS Report'[CAS Case ID]),SAMEPERIODLASTYEAR('Calendar'[DATES]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.