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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kozlevchar
Resolver I
Resolver I

PREVIOUSYEAR not returning data

PREVIOUSYEAR (Doesn't fail but returns no data).  The Date column in my Calander is set to "Date".  Here's the formula:

 

Spend PY = CALCULATE(SUMX('Key Measures', 'Key Measures'[Spend]) , PREVIOUSYEAR('Calendar'[Date]))
 
Any help/ideas would be much appreciated.
 
Thanks,
 
John
1 ACCEPTED SOLUTION
kozlevchar
Resolver I
Resolver I

Thank you for the reply.  I kept working with it and when I took the SUMX out fo the formula it worked and now shows data.  Don't quite understand why as I thought you had to use another formulas with CALCULATE.  

 

Thanks,

 

John

View solution in original post

4 REPLIES 4
kozlevchar
Resolver I
Resolver I

Thank you for the reply.  I kept working with it and when I took the SUMX out fo the formula it worked and now shows data.  Don't quite understand why as I thought you had to use another formulas with CALCULATE.  

 

Thanks,

 

John

littlemojopuppy
Community Champion
Community Champion

Hi @kozlevchar check that you have a date table and that it's marked as one.  PREVIOUSYEAR is a time intelligence function and requires a date table in order to work properly.

Hi,

 

Thank you for the reply.  I have  Date table and it's marked as a Date Table

@kozlevchar can you share the pbix?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.