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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
vanessafvg
Super User
Super User

cant seem to get sameperiodslast year to work

is this correct?

 

No of Crimes Last Year = CALCULATE([No Of Crimes], SAMEPERIODLASTYEAR('Date'[Date].[Date]))

 

this is the result i am getting Capture.PNG





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




4 REPLIES 4
Phil_Seamark
Employee
Employee

Hi @vanessafvg

 

Do you have a calendar table called Date? and is it related ok to your table?

 

Otherwise try

 

No of Crimes Last Year = CALCULATE([No Of Crimes], SAMEPERIODLASTYEAR('Date'[Date]))

and make sure you use a field from your Calendar table in the axis if your visual


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

ps yes i used a calendar table





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Is [No of Crimes] a measure?  If so can you post the code here?  There may be something in that code that is preventing the new formula from working 100% correct.

if i place it on the matrix depending on how i am looking at it it shows the right result but it seems like it could be complex in terms of displaying, how do you usually do that and it only seems to show on the new matrix.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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