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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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