cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
olegraikov89
Frequent Visitor

SAMEPERIODLASTYEAR without proper calendar

Hi Everyone!

Could you please help with the current problem:

I try to use SAMEPERIODLASTYEAR formula and my calendar has no any information about days (cause I get just monthly sales) and it looks like this (below it's just a part, I have 2020-2022 period). PERIOD_KEY - it's a date format I get from vendor, so I've created another 4 column to define year and month (first day of month). And when I try to use this formula nothing happens: 

LAST_PERIOD = CALCULATE([TOTAL_SALES_pack],SAMEPERIODLASTYEAR(Periods[Date]))

PERIOD_KEYYEARMonthDateQrtMonth_№
2020012020Jan01.01.2020Q11
2020022020Feb01.02.2020Q12
2020032020Mar01.03.2020Q13
2020042020Apr01.04.2020Q24
2020052020May01.05.2020Q25
2020062020Jun01.06.2020Q26
2020072020Jul01.07.2020Q37
2020082020Aug01.08.2020Q38
Thank you in advance and hug you!:-)
1 ACCEPTED SOLUTION

@olegraikov89 , No, JUst mark that as date table. There can few reason it can still fail

 

refer https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw




Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@olegraikov89 , Use date table

LAST_PERIOD = CALCULATE([TOTAL_SALES_pack],SAMEPERIODLASTYEAR(Date[Date]))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Hi, thank you!

The thing is Period this is my date table or I need to rename it as Date?

@olegraikov89 , No, JUst mark that as date table. There can few reason it can still fail

 

refer https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw




Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors