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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

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

@Anonymous , 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-bd52912a5bd4

 

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


Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , 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-bd52912a5bd4
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.

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, thank you!

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

@Anonymous , 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-bd52912a5bd4

 

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


Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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