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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Huei
Frequent Visitor

SAMEPERIOD Last Year in calculated column

Hi ,
 
This is my measure for PY Sales Amt and it give me correct calculation.
PY Sales Amt = CALCULATE(Sellout[Sales Amt],SAMEPERIODLASTYEAR(Dates[Date].[Date]))
 
But i want to calculate Last year Sales Amt by using calculated column. is it possible?
 
Any can advise?
 
Thanks
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Huei;

 

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @Huei;

 

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
Community Support

Hi, @Huei ;

You could try it.

PY Sales Amt =
CALCULATE ( SUM ( [Sales Amt] ), SAMEPERIODLASTYEAR ( Dates[Date] ) )

Or

PY Sales Amt =
CALCULATE ( SUM ( [Sales Amt] ), DATEADD ( Dates[Date], -1, YEAR ) )

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

Sorry for late reply. yes, it's works. Thanks

Huei
Frequent Visitor

Hi amitchandak,

 

i want the PY Sales Amt to calculated as a column instead of measure. Can this be done?

amitchandak
Super User
Super User

@Huei , Do not use .date. Mark date table as date table. after that you will not get .date

 

PY Sales Amt = CALCULATE(Sellout[Sales Amt],SAMEPERIODLASTYEAR(Dates[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...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.