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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
admin11
Memorable Member
Memorable Member

How to modify EXP expression to get Last Year Amount ?

Hi All

 

I have below expression sales amount , it will plot current year :-

SALES_ = SUM(SALES[sales])

 

Below expression will plot last year sales amount :-

SALES_LY = CALCULATE( SUM(SALES[sales]), DATEADD('Date'[Date], -1, YEAR))

 

i will get chart look like below :-

admin11_0-1621600352509.png


Now i have expression for Exp Amount , it can plot current year exp amount :-

AMOUNT_EXP_ =
CALCULATE(
SUM(GL[AMT])*1,
FILTER(
GL,
GL[1_EXP]="EXP"
)
)

How to convert above expression , so that it will plot last year Exp amount ? So that i can get the chart look like above for expense.

 

My PBI file :-

https://www.dropbox.com/s/0vxehy63q1nz4h4/PBT_V2021_400%20GL_TI_3.pbix?dl=0


Paul

 

 

1 ACCEPTED SOLUTION

Hi,

Download my PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@admin11 , Try like

AMOUNT_EXP_LY = CALCULATE([AMOUNT_EXP_], DATEADD('Date'[Date], -1, YEAR))

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

@amitchandak 

Thank you for sharing. i have try you expression , and when i just plot your expression alone , it return correct result. see below image :-

admin11_0-1621637320722.png

when i combine your expression with 2021 Exp amount expression , it return wrong result :-

admin11_1-1621637548117.png

My PBI sample file :-

https://www.dropbox.com/s/to10ko59wgs9lww/PBT_V2021_400%20GL_TI_4.pbix?dl=0

 

Paul

Hi,

Download my PBI file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

SamePeriodLastYear command working well , thank you very much

Paul

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors