Forum Discussion

Prasad_chattu's avatar
Prasad_chattu
Regular Visitor
1 year ago
Solved

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. 

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 ??


 

  • 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?

     

2 Replies

  • 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?