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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.