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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Prasad_chattu
Regular Visitor

Sameperiodlastyear () issue

Hey everyone ,

I was trying to check the "last year incidents" through Sameperiodlastyear() dax function.

Total Incidents = DISTINCTCOUNT(Reported_Incidents[Incident No])
Last_Year_Incidents = CALCULATE([Total Incidents],SAMEPERIODLASTYEAR('Date Table'[Date]))
 
Getting same year values. 
Prasad_chattu_0-1741061529498.png

Verified :
1. Created a Separate "Date Table" and  Marked it as "Date" table.

2. Have 1 to Many Relationship between "Date Table" and "Incidents Table".


Am i missing something here ??


 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Prasad_chattu 

Make sure that the Year column used in the visual is 'Date Table'[Year].

Based on the measure values in the screenshot, it appears that the Year column may be from Reported_Incidents or another table.

 

Does that fix it?

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
Prasad_chattu
Regular Visitor

Yes its fixed. Thank you @OwenAuger 

OwenAuger
Super User
Super User

Hi @Prasad_chattu 

Make sure that the Year column used in the visual is 'Date Table'[Year].

Based on the measure values in the screenshot, it appears that the Year column may be from Reported_Incidents or another table.

 

Does that fix it?

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.